我正在尝试将 WSDL 文件转换为 C# 代码,例如
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")]
[System.Web.Services.WebServiceBindingAttribute(Name = "ServiceSoap", Namespace = "http://test.com/")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName = "ServiceSoap", Namespace = "http://test.com/" )]
public interface IServiceSoap
{
/// <remarks/>
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://test.com/ping", RequestNamespace = "http://test.com/", ResponseNamespace = "http://test.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[System.ServiceModel.OperationContractAttribute(Action = "http://test.com/ping", ReplyAction = "*")]
string ping();
}
但是wsdl /serverInterface File:///C:/service.wsdl
,我得到这样的代码:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.7.3081.0")]
[System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap", Namespace="http://test.com/")]
public interface IServiceSoap {
/// <remarks/>
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://test.com/ping", RequestNamespace="http://test.com/", ResponseNamespace="http://test.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
string ping();
}
谁能让我知道什么工具可以做到这一点?或者我可能需要 wsdl.exe 的哪些配置?谢谢。