Installation :
Add the dll reference to your project.

Loading wsdl :
SoapClient client = new SoapClient("http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl");

Manually load and save wsdl
SoapClient client = new SoapClient();
client.LoadWSDL("http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl", true);

First parameter is the wsdl url, second is to save or not wsdl definition to increase performance.

Setting soap header
client.Header = new SoapHeader();
client.Header.Name = "AuthHeader";
client.Header.Add("UserName", "test");
client.Header.Add("PassWord", "test");

Invoking operation
client.Invoke("GetWeatherInformation");

with parameters
client.Invoke("GetCityWeatherByZIP", "ZIP");



Last edited Apr 18, 2012 at 9:43 AM by Madagaga, version 1

Comments

santoshy Oct 20, 2015 at 7:10 AM 
I am using third party web service which is made in Java language and for calling I am using your SoapClient library but I am getting error "Index was out of range" in soapclient.cs at line no 184.

In our web service we are using digest authentication with username and password but no certification.

Can you please help me out

Regards,
Santosh