Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating a Web service proxy from a WSDL C#

I am working with Fedex webservice. They did not provide a webservice URL like http://hostServer/WebserviceRoot/WebServiceName.asmx. Rather they provided a .wsdl file.

Please guide me in generating the web service proxy classes from the .wsdl file and adding a web service reference to my project.

I know to generate the proxy from wsdl like

wsdl /l:cs /protocol:SOAP /o:MyProxy.cs mywsdl.wsdl

but I want to know what it does. It may create the proxy class but how can I add the web service reference to my project?

like image 701
Mou Avatar asked Jul 06 '11 17:07

Mou


People also ask

How do I create a proxy class in WSDL?

After creating the directory we will write a Proxy class by “wsdl” command on a specified location. Just write wsdl and paste your URL that was copied from the web browser of the web service file . asmx and press Enter to create it. It will create a Proxy class on the selected location.

What is WSDL proxy?

wsdl is a tool for generating proxy classes that can be used to access to web services. The tool reads a WSDL document from the provided path or url, and downloads referenced schemas or other WSDL documents if needed. This tool is used to target the 1. x API, for targetting the 2.

How do I create a web service out of wsdl?

In Visual Studio, create or open an Enterprise Server Application project that contains a WSDL file that describes a COBOL application. In the Solution Explorer, right-click the WSDL file; then select Generate Web Service from the context menu.

What is proxy in webservice C#?

A proxy class maps parameters to XML elements and then sends the SOAP messages over a network. In this way, the proxy class frees you from having to communicate with the Web service at the SOAP level and allows you to invoke Web service methods in any development environment that supports SOAP and Web service proxies.


1 Answers

If you are creating the proxy classes manually, you need only add them to your project. The Add Web Reference mechanism in Visual Studio is used to automate this process and add the types in.

The wsdl executable will read the WSDL file that you've downloaded ("mywsdl.wsdl"), and generate the proxy code, in your example in the C# language (in "MyProxy.cs"). You can add "MyProxy.cs" to your project and start instantiating instances of the generated client in your project.

like image 200
Matthew Abbott Avatar answered Sep 24 '22 02:09

Matthew Abbott