从WSDL生成的Web服务,但在合同中有不同的情况 [英] Generated Web Service from WSDL but having case different in contract
问题描述
我使用以下命令从WSDL生成了Web服务:
wsdl.exe myFile.wsdl / l:CS / serverInterface
但它生成的案例与WSDL不同,我有调试3个小时后才知道这个问题。
例如:
公共类MyWebService:System.Web.Services.WebService,IMyWsdlInterface
{
[WebMethod]
公共字符串GetSomeString(字符串yourName)
{
//你必须编写自己的业务逻辑
返回你好,+ yourName +!;
}
}
我生成的接口:
公共抽象字符串GetSomeString(string yourName);
但是实际的WSDL包含:
public abstract string GetSomeString(string yourNAME);
yourName 和 YourNAME 对我来说是神奇的!
我无法找出错误背后的原因,所以请让我知道背后的原因。
谢谢。
你的问题根本没有任何意义。这两种方法完全相同:
public abstract string GetSomeString( string yourName);
和
public abstract string GetSomeString( string yourNAME);
抽象方法参数的名称没有区别,只要它们在参数列表中是唯一的并且是有效的.NET名称。
- SA
Hi,
I have generated web service from WSDL using following command:
wsdl.exe myFile.wsdl /l:CS /serverInterface
however it has generated different case than WSDL and I have come to know about this issue after 3 hours of Debugging.
For eg:
public class MyWebService : System.Web.Services.WebService, IMyWsdlInterface { [WebMethod] public string GetSomeString(string yourName) { //you'll have to write your own business logic return "Hello, " + yourName + "!"; } } My generated Interface: public abstract string GetSomeString(string yourName);
But actual WSDL contains:
public abstract string GetSomeString(string yourNAME);
yourName and YourNAME are the magic for me!
I am unable to figure the reason behind the error, so kindly let me know the reason behind it.
Thanks.
Your question does not make any sense at all. Those two methods are 100% identical:
public abstract string GetSomeString(string yourName);
and
public abstract string GetSomeString(string yourNAME);
The names of the abstract method arguments make no difference, as soon as they are unique in the argument list and are the valid .NET names.
—SA
这篇关于从WSDL生成的Web服务,但在合同中有不同的情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!