I have a website that has a simple web service. I can successfully call the web service from javascript on the page. I need to be able to call the same web service from a C # forms application. The web service code is very simple:
[WebService(Namespace = "http://myurl.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class IDCService : System.Web.Services.WebService {
public IDCService () {
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
My javascript is working:
function HelloWorld() {
var yourName = $get('txtYourName').value;
alert(yourName);
IDCService.HelloWorld(HelloWorldCalback, failureCB);
}
function HelloWorldCalback(result) {
alert(result);
}
function failureCB(result) {
alert("Failed");
}
However, when I try to establish a link to WS in my C # code, what I expect to see is an object with the HelloWorld method, what I actually see is an object with properties like HelloWorldRequest, HelloWorldResponse "," HelloWorldRequestBody "etc.
I am new to web services and am very confused. Any help would be appreciated.
Fraser orr
source
share