tags:

views:

231

answers:

3

I have been playing around in PHP with it and got something to work, what i did was:

$client = new SoapClient("http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl");
$fetchedArr = $client->GetCityForecastByZIP(array("ZIP" => "10451")); //get the weather in the bronx YO!

And now i would like my application i WPF/C# to do the same. What is the equivalent in c#?

+4  A: 

The simplest way is to use VS and add a web reference. This automatically creates the stub for you

thelost
Oh, nice... ill give it a try when i get home then! :D
Jason94
Works as a charm :D
Jason94
A: 

You can use the "wsdl.exe" command from the .NET SDK to generate the wrapper classes if you don't want or like to use Visual Studio.

see: http://msdn.microsoft.com/en-us/library/7h3ystb6%28VS.80%29.aspx

Chuvke
A: 

You can use the WSDL tool to generate a C# file which will contain the necessary types and members to talk to the web service or you could add a Web Service reference. See here for more details.

alimbada