Results 1 to 2 of 2

Thread: please help! desperate : SOAP again!

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    please help! desperate : SOAP again!

    HI,

    I have the following simple webservice:
    Code:
    <WebMethod()> Public Function HelloWorld2(ByVal mess As String) As String
            HelloWorld2 = mess
    End Function
    I am trying to get it to execute with a SOAP message by the following code:
    Code:
    Dim xmlHttp = CreateObject("Microsoft.XMLHTTP")
    
    soapTest = "POST /tkTest/tkTest.asmx HTTP/1.1" & vbLf
                soapTest = soapTest & "Host:       localhost" & vbLf
                soapTest = soapTest & "Content-Type: text/xml; charset=utf-8" & vbLf
                soapTest = soapTest & "Content-Length : 4" & vbLf
                soapTest = soapTest & "SOAPAction: ""http://localhost/tkTest.asmx/HelloWorld2""" & vbLf
    
                soapTest = soapTest & "<?xml version=""1.0"" encoding=""utf-8""?>" & vbLf
                soapTest = soapTest & "<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/"">" & vbLf
                soapTest = soapTest & "<soap:Body>" & vbLf
                soapTest = soapTest & "<HelloWorld2 xmlns=""http://localhost/tkTest.asmx"">" & vbLf
                soapTest = soapTest & "<mess>test</mess>" & vbLf
                soapTest = soapTest & "</HelloWorld2>" & vbLf
                soapTest = soapTest & "</soap:Body>" & vbLf
                soapTest = soapTest & "</soap:Envelope>" & vbLf
    xmlHttp.open("POST", "http://localhost/tktest/tktest.asmx",false)
    xmlHttp.send(soapTest)

    on the last line however i get "The parameter is incorrect" and then loads of lines of stuff that i can't make much sense of. Any body able to help? I am starting to get desperate now as i've tried everything i can think of to get this to work.

    Cheers
    Nick
    Last edited by nswan; Nov 5th, 2003 at 06:46 AM.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width