-
-
Notifications
You must be signed in to change notification settings - Fork 3
Make a simple call
Cussa Mitre edited this page Sep 2, 2017
·
5 revisions
When you just want to do a simple call, this is the easiest approach!
Create the WebService with the url and the namespace (optional). If you don't provide the namespace, the default "http://tempuri.org/" will be used. When call the Invoke method, inform which web method you want and what is the return type.
var wsCon = new WebService("http://localhost/XitSoap/ProductService.asmx");
var result = wsCon.Invoke<Product>("GetProduct");
2 Lines. Request done!
No. The WebService constructor has a overload where you can provide the namespace.
var wsCon = new WebService("http://localhost/XitSoap/ProductService.asmx", "http://tempuri.org/");
var result = wsCon.Invoke<Product>("GetProduct");
Still 2 Lines. Request done!
- Home
- Migrating from v1 to v2
- Referencing the Library
- Make a simple call
- Adding Parameters
- Adding Authentication
- Adding Custom Headers
- Calling a web method without use a typed return
- Using the WsContract and the ServiceCatalog
- Using the WsContract just to use the namespace
- Using the WsMapper: no more ugly properties!
- SoapActionComplement: because sometimes it's necessary even more!