Alex N.
Alex N.

Reputation: 15965

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.

Upvotes: 7

Views: 35822

Answers (2)

rifferte
rifferte

Reputation: 1412

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.

Upvotes: 4

John Saunders
John Saunders

Reputation: 161831

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.

Upvotes: 6

Related Questions