Skip to main content
Participating Frequently
May 1, 2009
Answered

Web Service - Call with URL and return SOAP?

  • May 1, 2009
  • 1 reply
  • 1451 views

Hello,

Is there a way to call a Coldfusion web service with a URL like http://site/component.cfc?method=dosomething&parm=1, and send the response back as SOAP? Seems I receive a wddx response when I do it this way. I know I can create a web service object and invoke it from Coldfusion, which is really nice since we can use the SOAP response just like a query object. Is there a way to do this "invoking" just from a http call?

Thanks!

This topic has been closed for replies.
Correct answer craigkaminsky

I've used that approach to interact with CFCs from an Ajax call on the client, returning JSON or XML from the CFC but do not think that this approach would be ideal for returning a SOAP response.

Technically, you could use that approach to return a SOAP response, however, it means your CFC method would need to generate and return the SOAP XML itself. CF won't automatically do this for you as it does when you call a CFC as a Web Service.

You can call a web service from CFHTTP but I think it's much more work than using CFINVOKE. There's a nice blog post on this approach:

http://www.jamesnetherton.com/blog/2007/01/14/Invoking-a-webservice-using-CFHTTP/

1 reply

craigkaminskyCorrect answer
Inspiring
May 1, 2009

I've used that approach to interact with CFCs from an Ajax call on the client, returning JSON or XML from the CFC but do not think that this approach would be ideal for returning a SOAP response.

Technically, you could use that approach to return a SOAP response, however, it means your CFC method would need to generate and return the SOAP XML itself. CF won't automatically do this for you as it does when you call a CFC as a Web Service.

You can call a web service from CFHTTP but I think it's much more work than using CFINVOKE. There's a nice blog post on this approach:

http://www.jamesnetherton.com/blog/2007/01/14/Invoking-a-webservice-using-CFHTTP/

vootmonAuthor
Participating Frequently
May 4, 2009

Wow, thanks for the help! That was exactly what I needed. Very helpful.