简体   繁体   English

MonoTouch WCF服务Reference.cs错误

[英]MonoTouch WCF Service Reference.cs Errors

I have a very simple WCF Service it has a single method GetDateTime(), I have it hosted in IIS on Windows 7, all seems to working fine in the windows environment, I can execute using test client application. 我有一个非常简单的WCF服务,它只有一个方法GetDateTime(),我将它托管在Windows 7上的IIS中,在Windows环境中一切似乎都可以正常工作,我可以使用测试客户端应用程序来执行。

On my Mac using MonoTouch I have added a web reference to the Service, it finds the service and generates a whole lot of files. 在使用MonoTouch的Mac上,我已对服务添加了Web引用,它可以找到服务并生成大量文件。

When I compile the Mono project there is an error in the Reference.cs file that has been generated. 当我编译Mono项目时,Reference.cs文件中已生成错误。

The GetDateTime Method in the interface has been declared with a return type GetDateTimeResponse instead of System.DateTime. 接口中的GetDateTime方法已使用返回类型GetDateTimeResponse而不是System.DateTime声明。

Any idea what has gone wrong is this a bug or have I missed something? 知道这出了什么问题是错误的,还是我错过了什么?

[System.ServiceModel.ServiceContractAttribute(Namespace="LastPrice.win7pro")]
public interface ITest {

    [System.ServiceModel.XmlSerializerFormatAttribute()]
    [System.ServiceModel.OperationContractAttribute(Action="http://win7pro/ITest/GetDateTime", ReplyAction="http://win7pro/ITest/GetDateTimeResponse")]
    GetDateTimeResponse GetDateTime(GetDateTime GetDateTime);

    [System.ServiceModel.XmlSerializerFormatAttribute()]
    [System.ServiceModel.OperationContractAttribute(Action="http://win7pro/ITest/GetDateTime", ReplyAction="http://win7pro/ITest/GetDateTimeResponse", AsyncPattern=true)]
    System.IAsyncResult BeginGetDateTime(GetDateTime GetDateTime, System.AsyncCallback asyncCallback, object userState);

    GetDateTimeResponse EndGetDateTime(System.IAsyncResult result);
}

This is a bug in Mono's WSDL generation. 这是Mono的WSDL生成中的错误。

I created a simple test case for this, using Visual Studio 2012 Web Express, and it is working fine when copying the Reference.cs file from the Windows machine. 我使用Visual Studio 2012 Web Express为此创建了一个简单的测试用例 ,当从Windows计算机复制Reference.cs文件时,它工作正常。

This is now fixed in mono/master commit aa2e9ec . 现在,此问题已在mono / master commit aa2e9ec中修复

The bug affects all parameterless service methods with complex return types. 该错误会影响具有复杂返回类型的所有无参数服务方法。

As a temporary workaround, use SlSvcUtil.exe on Windows to create the client proxy or add a dummy parameter to your service method. 作为临时的解决方法, SlSvcUtil.exe在Windows上使用SlSvcUtil.exe创建客户端代理或向服务方法中添加虚拟参数。

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

相关问题 返回自定义类的WCF服务在Reference.cs中生成错误 - WCF Service that returns a custom class generates errors in Reference.cs 有时添加 WCF 服务引用会生成一个空的 reference.cs - Sometimes adding a WCF Service Reference generates an empty reference.cs 处理wcf reference.cs异常 - Handling wcf reference.cs exceptions WCF reference.cs突然不包括类 - WCF reference.cs suddenly not including classes 将项目从.Net 4.6.1升级到4.7.x会导致WCF Reference.cs中出现错误 - Upgrading projects from .Net 4.6.1 to 4.7.x causes errors in WCF Reference.cs 添加服务引用后Reference.cs中的编译错误由多部分命名空间引起 - Compilation errors in Reference.cs after adding a Service Reference caused by multi-part namespace 添加服务引用无法正确生成Reference.cs - Adding service reference not generating correctly Reference.cs Web服务(ASMX)代理创建和reference.cs文件未生成 - Web service (ASMX) proxy creation and reference.cs file not generating 在调试WCF时,每次捕获异常时,如何禁用Reference.cs文件弹出? - How to disable Reference.cs file to pop-up each time an exception is caught while debugging WCF? Reference.cs中的Service Reference自动生成的类未作为内部生成 - Service Reference auto-generated classes in Reference.cs not being generated as Internal
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM