Calling WebMethod from SoapClient api does not process umlaut character properly

J

Jack Wright

Dear All,
I am using SoapClient 1.0 to call a WebMethod that takes a name and
returns a string...but if i call this webmethof with umlaut characters
what gets returned in place of umlaut characters is ??...am I doing
something wrong here is there a solution to this?
Here is the code...
Dim ws As New MSSOAPLib.SoapClient
txtURL.Text = "http://localhost/MyTest/WSSimple/Service1.asmx?wsdl"
ws.mssoapinit txtURL
txtName.Text = ws.HelloWorld2(txtError.Text)

I even tried using XMLHTTP but got the same result...
here is the code...
Set xmldom = CreateObject("Microsoft.XMLDOM")
Set pi = xmldom.createProcessingInstruction("xml", "
version=""1.0"" encoding=""utf-8""")
xmldom.insertBefore pi, xmldom.childNodes.Item(0)

Set objXMLroot = xmldom.createNode(1, "SOAP:Envelope",
"http://schemas.xmlsoap.org/soap/envelope/")

xmldom.appendChild (objXMLroot)
objXMLroot.setAttribute "xmlns:soap",
"http://schemas.xmlsoap.org/soap/encoding/"
objXMLroot.setAttribute "xmlns:xsi",
"http://www.w3.org/2001/XMLSchema-instance"
objXMLroot.setAttribute "xmlns:xsd",
"http://www.w3.org/2001/XMLSchema"

Set objxmlbody = xmldom.createElement("SOAP:Body")
xmldom.documentElement.appendChild (objxmlbody)

Set objxmlmethod1 = xmldom.createNode(1, "HelloWorld2",
"http://tempuri.org/")
objxmlbody.appendChild (objxmlmethod1)

Set objxmlparam1 = xmldom.createNode(1, "myName",
"http://tempuri.org/")
objxmlparam1.Text = Trim(txtError.Text)
objxmlmethod1.appendChild (objxmlparam1)

Set XMLHTTP = CreateObject("Microsoft.XMLHTTP")
XMLHTTP.Open "POST",
"http://localhost/Mytest/WSSimple/Service1.asmx", False
XMLHTTP.setRequestHeader "SOAPAction",
"http://tempuri.org/HelloWorld2"
XMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
XMLHTTP.send (xmldom)
MsgBox XMLHTTP.responseText, vbOKOnly, "Soap Response Payload from
Server"

Please help...

TALIA

Many Regards
Sunil
 
J

Jack Wright

This seems to be a problem with SoapClient 1.0...I checked SoapClient
3.0 and it is working fine...what is the most stable version of
SoapClient?

Please help...

TALIA
Many Regards
Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top