如何使用WCF的目标C
问题描述:
我试图通过消费的目标C的WCF“/www.xxxxx.net/xxxx.svc”我跟着从以下链接 Consume WCF Web Service using Objective-C on iPhone,如何使用WCF的目标C
我的步骤正在以下错误
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">The message with Action 'http://tempuri.org/IService1/GetMembers' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
请帮我在这方面, 在此先感谢
答
它尚不清楚是否要复制的代码的ObjectiveC原样与否。问题可能是SO中的代码回答你引用了硬编码无效的字符串,它是要发送到WCF服务的soap XML。如果您按原样复制代码,则需要发送对您的服务有效的soap XML。
如果您已经为您的WCF服务捕获了soap XML并且它不工作,那么问题仍然是格式不正确的soap消息。无论哪种情况,我都会首先捕获成功调用WCF服务的消息,以确定正确的soap XML应该是什么样子,并将其与您正在创建的soap XML进行比较,以查看问题出在哪里。
如果完全可能,请考虑向您的WCF服务添加webHttpBinding,以便您可以使用更简单的XML作为消息。看看这个网页上的这个four part walkthroughHttpBinding来了解它会发生什么。
用WCF配置显示你的WSDL或服务契约和实现。 – 2012-04-16 10:22:25