Mike asks:
I have a question regarding calling a SOAP web service and cfscript. I need to add some header information so I'm using the addSOAPRequestHeader Function. Anyhow, my question being is there a way I can debug and somehow see the exact SOAP XML request being sent over the wire?
Yes, you can do this, but it only works when you create an "instance" of the web service. Here is a simple example:
<cfset wurl = "http://localhost/test.cfc?WSDL">
<cfset ws = createObject("webservice", wurl)>
<cfset time = ws.time()>
<cfset req = getSoapRequest(ws)>
<cfdump var="#req#">
The important bit is the getSoapRequest function. You pass it the web service object, and you get back the XML-based SOAP request that was last used. Dumping it as I did gives you a formatted XML dump, but 'req' as is will give you the pure XML.
Archived Comments
It might also be worth mentioning that you can use any sort of decent packet inspection program to piece together a request. My favorite is the windows app Ethereal - it will break out a web service request by by HTTP **and** SOAP. It's a good way to learn about network stacks, as well.
Thanks for both answers.. Initially I had installed wireshark but was having problems with the filters. I'll check out Ethereal.
Axis TCP monitor is quite ok as well, check URL
http://ws.apache.org/axis/j...
Since CF uses Axis it's actually installed with CF...
SoapUI (free) is the ducks nuts... http://soapui.org/ although I only use the basics, not sure if it 'sniffs' your requests. It probably does.
Duck's nutts? That's a new one on me. :)
Another way to see SOAP Requests and Responses is to edit client-config.wsdd in /coldfusion/wwwroot/WEB-INF/ and remove the comments around the <requestFlow> and <responseFlow> lines, then restart Coldfusion, and the request/response should show up in /coldfusion/runtime/logs/coldfusion-out.log
(Tested in ColdFusion 8)
Here is an interesting article about advanced tools for soap monitoring - http://www.correlsense.com/...
Does anyone know how to log SOAP requests in ColdFusion (from which IP and which method?) http://stackoverflow.com/qu...
Thanks!
I answered.