简体   繁体   中英

Consuming WSDL file C#

I have a WSDL file and I want to consume that.
I have added the reference of that file in a window application ServiceReference1 .
Now there are two different classed one for request and another for response . I am not getting any method inside the request or response class.

Can any one guide me is there any thing I am doing wrong.

Don't look for the methods in the request or response. Look for them in the client.

You can use Reflection to get the methods of the Soap client like

Type type = obj.GetType();
var method = type.GetMethod("yourMethodName");
var attr = method.GetCustomAttributes(typeof(WebMethodAttribute), true);

Look at the SoapExtension Class and the article: Efficient Tracing Using SOAP Extensions in .NET

Also you can look at WebServiceStudio

Web Service Studio is a tool to invoke webmethods interactively. The user can provide a WSDL endpoint. On clicking button Get the tool fetches the WSDL, generates .NET proxy from the WSDL and displays the list of methods available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM