开发者

Call a Web Service

开发者 https://www.devze.com 2023-01-29 06:22 出处:网络
I have connected to a Web service by adding it as a web reference, the wsdl an开发者_开发问答d xsd files are now visable,

I have connected to a Web service by adding it as a web reference, the wsdl an开发者_开发问答d xsd files are now visable, im using visual studio,

How can I get a response from the Web service, i.e. send some data and get an error message back.

Thanks for your time.


Once you add a web service reference, Visual Studio will generate a strongly typed client proxy class which you could instantiate and invoke the web method:

using (var proxy = new SomeClientProxy())
{
    var result = proxy.SomeMethod("foo", "bar");
}


Just Create the object and use its method as you normally do with regular class objects

1- YourWebService obj = new YourWebService();

2- call methods on this object.

obj.YourWebServiceMethod();

0

精彩评论

暂无评论...
验证码 换一张
取 消