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
> -------------------------------------------------------------
>
>
>
>