-
-
Notifications
You must be signed in to change notification settings - Fork 3
Migrating from v1 to v2
Cussa Mitre edited this page Sep 2, 2017
·
1 revision
Here are the main differences between v1 and v2!
Before, we had 3 constructors for the WebService class:
public WebService()
{
}
public WebService(string baseUrl, string methodName = "", string @namespace = "http://tempuri.org/")
{
Url = baseUrl;
Method = methodName;
Namespace = @namespace;
}
But after some tests in real world (and not only and the company environment that use the library first), we come with some possible improvements. Now, when create a WebService object, you don't specify the methodName anymore. The second parameter is now the namespace. Please: verify your code as this will not create a break on your code, but can mislead you to wrong behavior when running the application.
public WebService(string url, string @namespace)
{
Url = url;
Namespace = @namespace;
}
So, this:
var wsCon = new WebService<ProductOutput>();
wsCon.Invoke("GetProduct");
var result = wsCon.ResultObject;
Became this:
var wsCon = new WebService();
var result = wsCon.Invoke<ProductOutput>("GetProduct");
Any new doubts will be putted here as new points for the migration guideline.
- 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!