Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on soap

Status
Not open for further replies.

Bammy217

Programmer
Sep 28, 2002
74
BE
Hey folks,

need some help here!!

Okay, we need to submit data to a soap based application, to be precise we need to port users (automated) and we need to login users, to allow them to proceed to one of our clients servers...

now here's the problem...having never used soap in my life and not beeing capable to find an easy to use example is there anyone out there who could help us...

what we need to submit:

Username & Password & SessionId

if there is anyone out there who could show me how to send the required information to a soap server, I would be much appreciative!!

Cheers,
D.

We never fail, we just find that the path to succes is never quite what we thought...
 
It's been quite a while since I looked at SOAP (basically since right before it was standardized) but if I rememer correctly you should be able to use the XMLHTTP object to send a request:
Code:
'this may be incorrect, we are trusting my memoryt after all :P
Dim objXMLHTTP
Set objXMLHTTP = Server.CreateObject("MSXML.XMLHTTP") 'please double check class name here, haven't used XMLHTTP in a while

Dim strSoapHeader
'check my namespace addy, may be out of date
strSoapHeader = &quot;<SOAP:Envelope xmlns=&quot;&quot;[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/&quot;&quot;>&quot;[/URL]
strSoapHeader = strSoapHeader & &quot;<SOAP:Header></SOAP:Header>
'etc and so on, filling in your soap info

'open and set the headers
objXMLHTTP.open &quot;POST&quot;, &quot;[URL unfurl="true"]http://www.yourURI.com&quot;,[/URL] False
objXMLHTTP.SetRequestHeader &quot;Content-Type&quot;,&quot;text/xml&quot;
objXMLHTTP.SetRequestHeader &quot;SOAPAction&quot;, &quot;soapserver/soap:YourModuleName#YourMethodName&quot;

'send the POST request
objXMLHTTP.Send

'receive the results
Dim strResults
strResults = objXMLHTTP.ResponseText

'if you want them in an XML DOM Object, do that here
Dim objXMLDoc
Set objXMLDoc = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
objXMLDoc.LoadXML strResults

'you now have all your xml, killthe http object to release the memory and have a nice day :)
Set objXMLHTTP = Nothing

'do your xml processing on the objXMLDoc, here we will just print it out to the screen using our earlier result string
Response.ContentType = &quot;text/xml&quot;
Response.Write strResults

'clean up after yourself
Set objXMLDoc = Nothing

And that should be at least the basis. You'll need to fill in the SOAP request stuf yourself as my memory really doesn't cover that and I also don't know your module and method names or URI address.

Hope that helps,
-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Durnit, one correction, didn't notice till after I hit the Submit button
Code:
The Line:
'send the POST request
objXMLhttp.Send

Should have been:
'send the POST request
objXMLhttp.Send strSoapHeader

Sorry about that,
-T


01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top