Web Services through SOAP and javascript
"M B HONG 20" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
Hi all-
I have made a web service using C#.NET, and must be able to call the
Web Methods from a client browser. I must make this work through
Netscape 7.0(Mozilla 1.0) so from what i read, I must use SOAP. My web
method is simple and just returns a boolean like so:
[WebService(Namespace="Say",Name="HelloWebService",Description="says
hello")]
...
[WebMethod]
public bool SayGoodBye()
{
return false;
}
and my client code looks like this:
var soapCall = new SOAPCall();
soapcall.transportURI = "http://localhost/WebService/Service1.asmx";
soapcall.encode(0, "SayGoodBye", null, 0, null, 0, null);
var result = soapcall.invoke();
alert(result.value);
However, I get an error saying that
"System.Web.Services.Protocols.SoapException: Unable to handle request
without a valid action parameter. Please supply a valid soap action"
then if i add the line "soapCall.actionURI = "SayGoodBye";" to the
script, i get this error:
"System.Web.Service.Protocols.SoapException: Server did not recognize
the value of HTTP Header SOAPAction: SayGoodBye."
Can anyone help? any help would be greatly appreciated. thanks in
advance.
Regards.