Consuming Web Service Fails Using cfinvoke But Successful With cfhttp?

262 views
Skip to first unread message

Jace Coleman

unread,
Jun 28, 2017, 11:14:19 AM6/28/17
to Lucee
I'm attempting to consume a client's web service using cfinvoke and am having some difficulty.  If i hand craft the request using cfhttp the web service returns a valid xml response.  However if I use cfinvoke, the service returns a java bean as a response.  I've used wireshark in an attempt to identify what's different between the two requests and as far as I can tell there are only minor differences in the request header.  I think that the most noticeable difference is that the successful request uses http/1.1 where the unsuccessful uses http/1.0.  Any idea why cfinvoke is sending using 1.0 or other ideas as to why these two requests result in vastly different responses?  the xml payload is the same.


unsuccessful request header (returns java bean)

POST /redact/Core/Security/redact.Core.Security.Login.asmx HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.4

Host: my.host.com

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: "http://product.com/ServiceLogin"

Content-Length: 412



successful request header:

POST /redact/Core/Security/redact.Core.Security.Login.asmx HTTP/1.1

Content-Type: text/xml; charset=utf-8

SOAPAction: "http://product.com/ServiceLogin"

Accept: application/soap+xml, application/dime, multipart/related, text/*

Connection:

Accept-Encoding: gzip

User-Agent: Lucee (CFML Engine)

Content-Length: 414

Host: my.host.com



In case it helps my cfinvoke call looks like this:

 <cfinvoke
method="ServiceLogin"
returnvariable="res">
<cfinvokeargument name="provider" value="redact"/>
<cfinvokeargument name="user" value="redact"/>
<cfinvokeargument name="password" value="redact"/>
<cfinvokeargument name="ticket" value=""/>
</cfinvoke>

and the cfhttp version:

<cfhttp url="http://redact/Core/Security/redact.Core.Security.Login.asmx" method="post" result="res">
<cfhttpparam type="header" name="Content-Type" value="text/xml; charset=utf-8"/>
<cfhttpparam type="header" name="SOAPAction" value='"http://redact.com/ServiceLogin"'/>
<cfhttpparam type="header" name="Accept" value="application/soap+xml, application/dime, multipart/related, text/*"/>
<cfhttpparam type="header" name="Connection" value=""/>
<cfhttpparam type="body" value="#xbody#"/>
</cfhttp>




Reply all
Reply to author
Forward
0 new messages