Skip to main content
Participant
February 17, 2009
Question

XML with SOAP wrapper

  • February 17, 2009
  • 1 reply
  • 617 views
I'm having problems consuming an XML service that is wrapped in SOAP. Here is the service:

POST /services/xxxx/Mapservice.asmx HTTP/1.1
Host: demo.xxxx.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: " http://demo.xxxx.com/services/GetPlayDefinition"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<CredentialSoapHeader xmlns=" http://demo.xxxx.com/services/">
<Username>string</Username>
<Password>string</Password>
</CredentialSoapHeader>
</soap:Header>
<soap:Body>
<GetPlayDefinition xmlns=" http://demo.xxxx.com/services/">
<WMSPlayDefinitionID>int</WMSPlayDefinitionID>
</GetPlayDefinition>
</soap:Body>
</soap:Envelope>

Here is my request:

<cfscript>

// Create the web service object.
ws = CreateObject("webservice", " http://demo.xxx.com/services/gmap/Mapservice.asmx?wsdl");

// Set the username header as a string.
addSOAPRequestHeader(ws, " http://demo.xxx.com/services/", "Username", "xxx", true);

// Set the password header as a string.
addSOAPRequestHeader(ws, " http://demo.xxx.com/services/", "Password", "xxx", true);

WMSInfo=ws.GetPlayDefinition(500);


</cfscript>

I do not believe I am sending out a properly structured request. Here is the error message: "SOAP header Username was not understood" .

I cannot seem to get any kind of tool working to view my outgoing HTTP header. I'm tired, stressed and under a sick deadline. What stupid thing am I doing wrong?

Thanks everyone!
This topic has been closed for replies.

1 reply

February 18, 2009
I'm also having an issue getting my SOAP request to work properly.

I have used this tool to see the outgoing request. Seems to work pretty well: http://www.nirsoft.net/utils/smsniff.html

I was able to retrieve what I was sending out. It was formatted correctly, but needs to use MTOM when sending it out. I'm going to post a question about it after this reply.