Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplest way of invoking a webservice via SOAP on ASP.NET

I have a webservice on a remote host that I need to invoke from ASP.NET/C# class. What is the simplest way of calling a method via SOAP, given WSDL url and a method signature?

Given: WSDL url as string(available only at runtime, i.e. variable) Method signature(constant)

Need to: Create a soap client and perform method call.

like image 880
Alex N. Avatar asked Jun 29 '09 01:06

Alex N.


2 Answers

The simplest thing to do is to just use "Add Service Reference" and point to the WSDL. It will generate the proxy classes for you, including a proxy method which should match the method signature you've been given.

See if you find How to Consume a Web Service to be helpful.

like image 117
John Saunders Avatar answered Sep 28 '22 10:09

John Saunders


See here: http://msdn.microsoft.com/en-us/library/d9w023sx.aspx

Its very easy in visual studio - you simply add the web reference url and it generates the proxy stub for you.

like image 33
rifferte Avatar answered Sep 28 '22 09:09

rifferte