Link to home
Start Free TrialLog in
Avatar of lempertv
lempertv

asked on

Coldfusion SOAP Web Service Requests issue

Hi there!
I have a ColdFusion 9 server. I need to make a SOAP Web Service request using Coldfusion but it does not work. The way it should work: coldfusion page sends a filtered SOAP service request to a remote (non coldfusion) server and the  returned page needs to be saved to a DB. I tried to follow Ben Nadel samples (http://www.bennadel.com/blog/1809-making-soap-web-service-requests-with-coldfusion-and-cfhttp.htm) but I'm getting a BLANK page in return.

Here is my request page:

<cfsavecontent variable="soapBody">
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <sch:GetClient>
         <!--Optional:-->
         <sch:request>
            <sch:RequestHeader>
               <!--Optional:-->
               <sch:ClientVersion>1001</sch:ClientVersion>
               <!--Optional:-->
               <sch:CustomerKey>123456789</sch:CustomerKey>
               <!--Optional:-->
               <sch:Password>MyPassword</sch:Password>
               <!--Optional:-->
               <sch:User>user@MyDomain.com</sch:User>
            </sch:RequestHeader>
            <!--Optional:-->
            <sch:Filter>
               <!--Optional:-->
               <sch:ClientID>456</sch:ClientID>
            </sch:Filter>
         </sch:request>
      </sch:GetClient>
   </soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>
 
<cfhttp url="https://webservice.domain.com/services/soap/2.1/Services.svc?wsdl" method="post" result="httpResponse">

<cfhttpparam type="header" name="SOAPAction" value="https://webservice.domain.com/services/soap/2.1/GetClient"/>
 
<cfhttpparam type="header" name="accept-encoding" value="no-compression"/>
<cfhttpparam type="xml" value="#trim( soapBody )#"/>

</cfhttp>
 

<cfif find( "200", httpResponse.statusCode )>
 
      
      <cfset soapResponse = xmlParse( httpResponse.fileContent ) />
 
      <cfset responseNodes = xmlSearch(
            soapResponse,
            "//*[ local-name() = 'GetClient' ]"
            ) />
 
      <cfoutput>
 
            Code: #responseNodes[ 1 ].Code.xmlText#
            <br />
            Success: #responseNodes[ 1 ].Message.xmlText#
      </cfoutput>
</cfif>

I dont know why it does not work.
Thanks for your help!
Avatar of LajuanTaylor
LajuanTaylor

Are you still looking to resolve this issue?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.