Correct. When I add line 4 I get the error. It is as if the SOAP header has "lost track" of the fact that I just passed in the username and password. getPlayDefinition expects a numeric and returns a string. The argument is an ID number. I get a catalog item description in return. Here is the wsdl - thanks very much! <?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://demo.xxx.com/services/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://demo.xxx.com/services/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" <http://schemas.xmlsoap.org/wsdl/> >WorkManagement MAP Integration WebService</wsdl:documentation> - <wsdl:types> - <s:schema elementFormDefault="qualified" targetNamespace="http://demo.xxx.com/services/"> - <s:element name="AbandonPlay"> - <s:complexType> - <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="WMSPlayID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="Reason" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="AbandonPlayResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="AbandonPlayResult" type="tns:AbandonPlayResult" /> </s:sequence> </s:complexType> </s:element> - <s:complexType name="AbandonPlayResult"> - <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="WMSPlayID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ServiceTimeStamp" type="s:dateTime" /> </s:sequence> </s:complexType> <s:element name="CredentialSoapHeader" type="tns:CredentialSoapHeader" /> - <s:complexType name="CredentialSoapHeader"> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /> </s:sequence> <s:anyAttribute /> </s:complexType> - <s:element name="ExecutePlay"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="MAPPayloadData" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="ExecutePlayResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="ExecutePlayResult" type="tns:ExecutePlayResult" /> </s:sequence> </s:complexType> </s:element> - <s:complexType name="ExecutePlayResult"> - <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="WMSPlayID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ServiceTimeStamp" type="s:dateTime" /> </s:sequence> </s:complexType> - <s:element name="GetPlayDefinition"> - <s:complexType> - <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="WMSPlayDefinitionID" type="s:int" /> </s:sequence> </s:complexType> </s:element> - <s:element name="GetPlayDefinitionResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetPlayDefinitionResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> - <wsdl:message name="AbandonPlaySoapIn"> <wsdl:part name="parameters" element="tns:AbandonPlay" /> </wsdl:message> - <wsdl:message name="AbandonPlaySoapOut"> <wsdl:part name="parameters" element="tns:AbandonPlayResponse" /> </wsdl:message> - <wsdl:message name="AbandonPlayCredentialSoapHeader"> <wsdl:part name="CredentialSoapHeader" element="tns:CredentialSoapHeader" /> </wsdl:message> - <wsdl:message name="ExecutePlaySoapIn"> <wsdl:part name="parameters" element="tns:ExecutePlay" /> </wsdl:message> - <wsdl:message name="ExecutePlaySoapOut"> <wsdl:part name="parameters" element="tns:ExecutePlayResponse" /> </wsdl:message> - <wsdl:message name="ExecutePlayCredentialSoapHeader"> <wsdl:part name="CredentialSoapHeader" element="tns:CredentialSoapHeader" /> </wsdl:message> - <wsdl:message name="GetPlayDefinitionSoapIn"> <wsdl:part name="parameters" element="tns:GetPlayDefinition" /> </wsdl:message> - <wsdl:message name="GetPlayDefinitionSoapOut"> <wsdl:part name="parameters" element="tns:GetPlayDefinitionResponse" /> </wsdl:message> - <wsdl:message name="GetPlayDefinitionCredentialSoapHeader"> <wsdl:part name="CredentialSoapHeader" element="tns:CredentialSoapHeader" /> </wsdl:message> - <wsdl:portType name="MAPServiceSoap"> - <wsdl:operation name="AbandonPlay"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" <http://schemas.xmlsoap.org/wsdl/> >Abandon WMS Play</wsdl:documentation> <wsdl:input message="tns:AbandonPlaySoapIn" /> <wsdl:output message="tns:AbandonPlaySoapOut" /> </wsdl:operation> - <wsdl:operation name="ExecutePlay"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" <http://schemas.xmlsoap.org/wsdl/> >Execute WMS Play</wsdl:documentation> <wsdl:input message="tns:ExecutePlaySoapIn" /> <wsdl:output message="tns:ExecutePlaySoapOut" /> </wsdl:operation> - <wsdl:operation name="GetPlayDefinition"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" <http://schemas.xmlsoap.org/wsdl/> >Retrieve WMS Play Definition (0 = All Play Definitions)</wsdl:documentation> <wsdl:input message="tns:GetPlayDefinitionSoapIn" /> <wsdl:output message="tns:GetPlayDefinitionSoapOut" /> </wsdl:operation> </wsdl:portType> - <wsdl:binding name="MAPServiceSoap" type="tns:MAPServiceSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="AbandonPlay"> <soap:operation soapAction="http://demo.xxx.com/services/AbandonPlay" style="document" /> - <wsdl:input> <soap:body use="literal" /> <soap:header message="tns:AbandonPlayCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="ExecutePlay"> <soap:operation soapAction="http://demo.xxx.com/services/ExecutePlay" style="document" /> - <wsdl:input> <soap:body use="literal" /> <soap:header message="tns:ExecutePlayCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="GetPlayDefinition"> <soap:operation soapAction="http://demo.xxx.com/services/GetPlayDefinition" style="document" /> - <wsdl:input> <soap:body use="literal" /> <soap:header message="tns:GetPlayDefinitionCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:binding name="MAPServiceSoap12" type="tns:MAPServiceSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="AbandonPlay"> <soap12:operation soapAction="http://demo.xxx.com/services/AbandonPlay" style="document" /> - <wsdl:input> <soap12:body use="literal" /> <soap12:header message="tns:AbandonPlayCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="ExecutePlay"> <soap12:operation soapAction="http://demo.xxx.com/services/ExecutePlay" style="document" /> - <wsdl:input> <soap12:body use="literal" /> <soap12:header message="tns:ExecutePlayCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="GetPlayDefinition"> <soap12:operation soapAction="http://demo.xxx.com/services/GetPlayDefinition" style="document" /> - <wsdl:input> <soap12:body use="literal" /> <soap12:header message="tns:GetPlayDefinitionCredentialSoapHeader" part="CredentialSoapHeader" use="literal" /> </wsdl:input> - <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:service name="MAPService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" <http://schemas.xmlsoap.org/wsdl/> >WorkManagement MAP Integration WebService</wsdl:documentation> - <wsdl:port name="MAPServiceSoap" binding="tns:MAPServiceSoap"> <soap:address location="http://demo.xxx.com/services/gmap/Mapservice.asmx" /> </wsdl:port> - <wsdl:port name="MAPServiceSoap12" binding="tns:MAPServiceSoap12"> <soap12:address location="http://demo.xxx.com/services/gmap/Mapservice.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
_____ From: [email protected] [mailto:[email protected]] On Behalf Of Ajas Mohammed Sent: Wednesday, February 18, 2009 11:49 AM To: [email protected] Subject: Re: [ACFUG Discuss] XML and SOAP ok so you are saying, line number 4 is causing the error? If yes, then can you email us the definition of this method getPlayDefinition, like what it expects and what it returns? I dont know what 297 means here because earlier you had 500 as a parameter for this method call. 1 . <cfscript> // Create the web service object. 2. ws = CreateObject("webservice", "http://demo.xxx.com/services/gmap/Mapservice.asmx?wsdl"); // Set the username header as a string. 3. addSOAPRequestHeader(ws, "http://demo.xxx.com/services/", "CredentialSoapHeader", myStruct, true); 4. WMSInfo=ws.getPlayDefinition(297); </cfscript> <Ajas Mohammed /> http://ajashadi.blogspot.com We cannot become what we need to be, remaining what we are. No matter what, find a way. Because thats what winners do. You can't improve what you don't measure. Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives. On Wed, Feb 18, 2009 at 12:16 PM, Shane <[email protected]> wrote: Sorry to beg - but I have to deliver this project this afternoon: These: varResult = ws.addSOAPRequestHeader(myStruct); varResult = ws.addSOAPRequestHeader(myStruct()); are not working. This doesn't give me an error: addSOAPRequestHeader(ws, "http://demo.xxx.com/services/", CredentialSoapHeader", myStruct, true); But when I try to run the method: <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/", "CredentialSoapHeader", myStruct, true); WMSInfo=ws.getPlayDefinition(297); </cfscript> I get this: Cannot perform web service invocation getPlayDefinition. The fault returned when invoking the web service operation is: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client <http://schemas.xmlsoap.org/soap/envelope/%7DClient> faultSubcode: faultString: Unable to retrieve Play Definition: Invalid UserName / Password combination I guess every time I run the method I have to pass in the username and password? Any thoughts? <sweat> Thanks, Shane _____ From: [email protected] [mailto:[email protected]] On Behalf Of Ajas Mohammed Sent: Wednesday, February 18, 2009 10:01 AM To: [email protected] Subject: Re: [ACFUG Discuss] XML and SOAP Hi Shane, Try this. <cfset myStruct = StructNew()> <cfset structInsert(myStruct, "UserName", "someuname")> <cfset structInsert(myStruct, "Password", "somepwd")> <cfscript> // Create the web service object. ws = CreateObject("webservice", "http://demo.xxx.com/services/gmap/Mapservice.asmx?wsdl"); //varResult should get the results once uname pwd is passed thru struct varResult = ws.addSOAPRequestHeader(myStruct); // or maybe this //varResult = ws.addSOAPRequestHeader(myStruct() ); WMSInfo=ws.GetPlayDefinition(500); </cfscript> This is what I could come up at this moment in 5 mins. I am sure, there might be something else to this. HTH, <Ajas Mohammed /> http://ajashadi.blogspot.com We cannot become what we need to be, remaining what we are. No matter what, find a way. Because thats what winners do. You can't improve what you don't measure. Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives. On Wed, Feb 18, 2009 at 10:44 AM, Shane <[email protected]> wrote: Kevin: Do you know of a good example posted somewhere I could look at? Now that I have started, I'm not sure how to go about this. Thanks! -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hellriegel Sent: Wednesday, February 18, 2009 8:58 AM To: [email protected] Subject: Re: [ACFUG Discuss] XML and SOAP I think you need to put the Username and Password inside CredentialSoapHeader. Try creating a struct with those two fields in it and pass it to the webservice as CredentialSoapHeader. CF should handle the rest. One tool I like to use is the web service explorer in Eclipse. It is a part of the Web Tools Platform. Granted, it does not monitor what you send out, but it does allow you to test wsdl's without writing any code and it helps you figure out what fields you need to pass. Hope this helps. Kevin On Tue, Feb 17, 2009 at 1:52 PM, Shane <[email protected]> wrote: > Hopefully posting this way will work: > > 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! > ------------------------------------------------------------- > To unsubscribe from this list, manage your profile @ > http://www.acfug.org?fa=login.edituserform > > For more info, see http://www.acfug.org/mailinglists Archive @ > http://www.mail-archive.com/discussion%40acfug.org/ > List hosted by FusionLink > ------------------------------------------------------------- ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com ------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.10.25/1957 - Release Date: 02/17/09 07:07:00 ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com ------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.10.25/1957 - Release Date: 02/17/09 07:07:00 ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink <http://www.fusionlink.com> ------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.10.25/1957 - Release Date: 02/17/09 07:07:00 ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------
