Skip to main content
Known Participant
April 7, 2009
Question

Is there any way to view the XML in a CFHTTP post?

  • April 7, 2009
  • 2 replies
  • 928 views

Hi, I am using CFHTTP to post to a SOAP web service and I am getting roughly what I expect to be returned. However I would really like to examine the raw XML as it is posted to the web service to learn more about the structure of the post. Is there any way to view the XML post?

I have enabled debugging etc. but it doesn't show me the info that I am after.

Thanks.

This topic has been closed for replies.

2 replies

Inspiring
April 7, 2009

I've been using two extensions for Firefox 3 to check out all my HTTP activity: (1) firebug and (2) HttpFox. HttpFox is a bit better when you want to really delve into the raw XML of SOAP responses and such. It helped me immensely when debugging some SOAP behaviors in an application recently. Here's a link to the HttpFox add-on: https://addons.mozilla.org/en-US/firefox/addon/6647

The nice thing about this tool is that you can start and stop it to trap/display your HTTP content when you want (i.e., turn it on and off easily!).

Known Participant
April 7, 2009

Thanks for that. I have been using Firebug for a while but I haven't come across HTTPFox yet, I'll give it a try when I get a moment.

Do you know if either of these will actually trap the outgoing XML or just the response?

April 7, 2009

Perhaps <cfdump var="#yourXMLVariable#" expand="TRUE"> will help you.  <cfdump> automatically renders XML datatypes in a tree-like structure.

Known Participant
April 7, 2009

I tried CFDump and it works great for viewing the response from the web server but I really want to trap and view the post more than the response. Thanks anyway

Inspiring
April 7, 2009

With HttpFox, you can check the raw SOAP that's part of the request AND the response (they show up as two separate entries in HttpFox -- one for the request and one for the response, which makes it easy to read/use). It's really nice that way. The Web Services I was dealing with required authentication (a pain in the butt I might add ). It wasn't working right, because of my code, of course, and HttpFox basically saved me. I was able to see how I was forming the SOAP XML for the request and note where I was missing some key values, etc.

Should do the trick for you!