Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > how to send a SOAP message

Reply
Thread Tools

how to send a SOAP message

 
 
wptpro@gmail.com
Guest
Posts: n/a
 
      02-07-2006
I need to send a soap message, is the the correct way of doing it? I
get an error back..."parsing error: org.xml.sax.SAXParseException:
Premature end of file."


Dim strRequest As String
Dim oXML As Object
Dim strResult As String

strRequest = "<?xml version='1.0' encoding='UTF-8' ?>" & vbCrLf
strRequest += "<SOAP-ENV:Envelope
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlnssi='http://www.w3.org/2001/XMLSchema-instance'
xmlnssd='http://www.w3.org/2001/XMLSchema'>" & vbCrLf
strRequest += "<SOAP-ENV:Header>" & vbCrLf
strRequest += "<Authentication>" & vbCrLf
strRequest += " <application_id>accountid</application_id>" &
vbCrLf
strRequest += " <password>thepassword</password>" & vbCrLf
strRequest += "</Authentication>" & vbCrLf
strRequest += "</SOAP-ENV:Header>" & vbCrLf
strRequest += "<SOAP-ENV:Body>" & vbCrLf
strRequest += " <ns1:getHandsetByPTN
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:ns1='urn:HandsetService'>" & vbCrLf
strRequest += " <applRef xsi:nil='true'
xmlnssi='http://www.w3.org/2001/XMLSchema-instance'
xsi:type='xsd:string' />" & vbCrLf
strRequest += " <ptn xsi:type='xsd:string'
xmlnssi='http://www.w3.org/2001/XMLSchema-instance'>8586883672</ptn>"
& vbCrLf
strRequest += "</ns1:getHandsetByPTN>" & vbCrLf
strRequest += "</SOAP-ENV:Body>" & vbCrLf
strRequest += "</SOAP-ENV:Envelope>"


' Create an xmlhttp object:
oXML = CreateObject("MSXML2.ServerXMLHTTP")
oXML.open("POST", "https://the url goes here", False)
oXML.setRequestHeader("Content-Type", "text/xml")
oXML.SetRequestHeader("Content-length", strRequest.Length)
oXML.SetRequestHeader("Connection", "Keep-Alive")
oXML.Send(strRequest)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to add SOAP header to a SOAP message? Peter van der veen ASP .Net Web Services 6 11-14-2006 06:44 PM
how to use servlet to receive message (not soap message) John Java 8 03-28-2005 01:39 PM
writing a SOAP message service, how do I get the attachment from a message? rabbits77 Java 0 02-26-2004 08:52 PM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP .Net 2 07-01-2003 11:29 AM



Advertisments