I'm trying to consume a WS from Excel (Office 98), seems that I can't
send arguments into the WS. In order to pinpoint the problem I've
written the following application i C# and VB6. It reproduces exaclty
the same problem with less code. Any hints on how to solve this would be
greatly appreciated. /Regards Björn
The webservice is:
using System;
using System.Web.Services;
[WebService(Namespace="http://tempuri.org/")]
public class DotNetWS : WebService {
[WebMethod]
public string ReturnArgument(string Argument) {
return Argument;
//return "We can't get Argument into WS!";
}
}
And this is the client:
Private Sub Command1_Click()
Dim mhttp As MSXML2.XMLHTTP
Dim s As String
Set mhttp = New MSXML2.XMLHTTP
mhttp.open "Post", "http://localhost/DotNetWS/DotNetWS.asmx", False
mhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
mhttp.setRequestHeader "SoapAction",
"http://tempuri.org/ReturnArgument"
s = s & "<?xml version=""1.0"" encoding=""UTF-8""?>"
s = s & "<soap:Envelope
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" "
s = s & "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" "
s = s & "xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
s = s & "<soap:Body>"
s = s & "<ReturnArgument xmlns=""http://tempuri.org"">"
s = s & "<Argument>Easy go, easy come back?</Argument>"
s = s & "</ReturnArgument>"
s = s & "</soap:Body>"
s = s & "</soap:Envelope>"
mhttp.send s
MsgBox mhttp.responseText
End Sub