【发布时间】:2011-09-05 06:56:36
【问题描述】:
我添加了一个使用 WCF 编写的 Web 服务作为参考。当我将代理类生成器添加为服务引用时,它可以完美地工作,但是当我使用 service.svc?WSDL 将其添加为 Web 引用时,它会生成一个稍微不同的类。以下是区别:
//service reference
public partial class TestServicesClient : ... // correct class name
{
public int TestMethod(string serviceID, int dealID) // correct method signature
{ ... }
}
//web reference
public partial class TestServices: ... //different class name
{
public void TestMethod(string serviceID, int dealID, bool dealIDSpecified, out int TestMethodResult, out bool TestMethodResultSpecified) // different method signature
{ ... }
}
我尝试使用 wsdl.exe 生成 web 参考类,没有帮助。
这里有什么问题?
【问题讨论】:
标签: c# .net wcf web-services