Correction:
I had to change the word sayHello to Helloworld, since that is my method
name.
Dim x, h,r, s, t, u, v,z
Set x = CreateObject("MSXML2.DOMDocument")
s ="<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'"
t = " xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'"
u = " xmlns:xsd='http://www.w3.org/1999/XMLSchema'>"
v = " <s:Body><m:HelloWorld xmlns:m='urn:Example1'>"
r = " <name
xsi:type='xsd:string'>James</name></m:HelloWorld></s:Body></s:Envelope>"
z= s & t & u & v & r
x.loadXML z
msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("Microsoft.XMLHTTP")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText,,"Output SOAP Message"
"Mark" <ma*********@acordia.com> wrote in message
news:ed**************@TK2MSFTNGP14.phx.gbl...
i have a very simple web servive
Imports System.Web.Services
<System.Web.Services.WebService(Namespace:="urn:Ex ample1")> _
Public Class Example1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal name As String) As String
Return "Hello " & name
End Function
End Class
I have a VB Script with which I'm trying to send a soap message with.
When i execute i get to the input soap message message box showing me the
message, but when i click ok, it seems to hang. i have to kill the script
through taskmgr. this is on windows 2000.
Any ideas why it wouldn't return?
Dim x, h
Set x = CreateObject("MSXML2.DOMDocument")
x.loadXML "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'><s:Body><m:sayHello
xmlns:m='urn:Example1'><name
xsi:type='xsd:string'>James</name></m:sayHello></s:Body></s:Envelope>"
msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("Microsoft.XMLHTTP")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText,,"Output SOAP Message"