简体   繁体   English

消耗WSDL文件C#

[英]Consuming WSDL file C#

I have a WSDL file and I want to consume that. 我有一个WSDL文件,我想使用它。
I have added the reference of that file in a window application ServiceReference1 . 我已经在窗口应用程序ServiceReference1添加了该文件的引用。
Now there are two different classed one for request and another for response . 现在有两种不同的分类,一种用于request ,另一种用于response I am not getting any method inside the request or response class. 我在requestresponse类中没有任何方法。

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 您可以使用反射来获取Soap客户端的方法,例如

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 查看SoapExtension类和文章: .NET中使用SOAP扩展的有效跟踪

Also you can look at WebServiceStudio 你也可以看一下WebServiceStudio

Web Service Studio is a tool to invoke webmethods interactively. Web Service Studio是一种交互式调用Web方法的工具。 The user can provide a WSDL endpoint. 用户可以提供WSDL端点。 On clicking button Get the tool fetches the WSDL, generates .NET proxy from the WSDL and displays the list of methods available. 单击“获取”工具后,该工具将获取WSDL,从WSDL生成.NET代理并显示可用方法列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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