GetHTTPRequestData() Breaks The SOAP Request / Response Cycle In ColdFusion
Posted June 5, 2009 at 8:38 AM
Yesterday, when I was experimenting with SOAP request error handling inside of the ColdFusion application framework, I came across what I think is a ColdFusion bug. It seems that if you call ColdFusion's GetHTTPRequestData() method during a SOAP request, the method executes properly, returning the HTTP request data, but it breaks the SOAP response, throwing the following error:
org.xml.sax.SAXParseException: Premature end of file.
To see this in action, check out this video:
| | | | | |
| | | |||
| | | |
In the video, I am using CFDump to output the GetHTTPRequestData() to an external file:
Application.cfc
Launch code in new window » Download code as text file »
- <cfcomponent
- output="false"
- hint="I provide application settings and event handlers.">
-
- <cfsetting showdebugoutput="false" />
-
- <cftry>
-
- <cfdump
- var="#GetHTTPRequestData()#"
- format="html"
- output="#ExpandPath( './soaprequest.htm' )#"
- />
-
- <cfcatch>
-
- <cfdump
- var="#CFCATCH#"
- format="html"
- output="#ExpandPath( './soaprequest.htm' )#"
- />
-
- </cfcatch>
-
- </cftry>
-
- </cfcomponent>
... however, the same error occurs even I simply call GetHTTPRequestData() and store the result into the Application.cfc public scope:
Launch code in new window » Download code as text file »
- <cfset this.test = GetHTTPRequestData() />
So, it's clearly not a problem with CFDump, but rather with the invocation of the GetHTTPRequestData() method itself. Unless I am missing something obvious here, this appears to be a bug in the way that GetHTTPRequestData() interacts with SOAP-based requests. Any thoughts?
Download Code Snippet ZIP File
Post Comment | Ask Ben | Other Searches | Print Page
Newer Post
jQuery And Script Tags As Data Containers
Older Post
SOAP Web Service Errors Are Handled Externally To The ColdFusion Application Framework
Reader Comments
Yep, I ran into this issue when using CF to secure a webservice via Basic Auth: http://www.mischefamily.com/nathan/index.cfm/2008/8/13/Basic-Authentication-With-ColdFusion
I can't remember if I reported it as bug or not.
@Nathan,
No problem, I just submitted it as a bug.
Ben, did you get any fix for this. i am having the same issue. i do have a soap webservice which is not serving any wsdl, i am trying to access that but i am getting the the same error you are getting. can you post the complete code including soap header etc...thanks.
@Manju,
There is no fix for this at the moment, other than to not use GetHTTPRequestData() in conjunction with SOAP web services calls, as far as I know. Perhaps Adobe will fix this bug in later releases.
i have couple questions.
i have a webserver i need to access invoke some soap web servies. but there is no wsdl served by the server( it is a third party server built in some C# or so). but i have a wsdl the company sent me can i save that on to my server and point that to web service hosting server and use that. is that possible....some one on the web said it is possible. i never did anything like that. untill now what ever i use had WSDL so i used direct cfinvoke...that's it. now i am trying to use soap route...
if i can not use the above method (saving wsld locally) or get HTTP then what other route i can go...let me know and post me some sample code.. thanks for your help




