2

语境 :

SAP 解决方案管理器(将其称为 SolMan)公开了一个 SOAP Web 服务,第 3 方可以调用它与它进行互操作。第 3 方应用程序也可以实现相同的 web 服务接口,以便 SolMan 可以在另一个方向上互操作。我需要在两个方向上与 SolMan 进行互操作。我的 Web 服务是一个 WCF 服务,它基于 SolMan Web 服务的 WSDL 生成的接口和类型,带有 VS2010“添加服务参考”。

问题 #1

在 WSDL 中,所有声明的操作都有 soapAction=""。当从VS2010生成服务契约接口时,所有OperationContractAttribute都是Action="",ReplyAction="*"。由于多个 OperationContract 具有相同的 Action(空字符串),Webservice 不起作用,例外情况是:

[InvalidOperationException:AcceptIncidentProcessing 和 AddInfo 操作具有相同的操作 ()。每个操作都必须具有唯一的操作值。]

这是正常的吗?除了从生成的 ServiceContract 接口中删除所有 Action="" 声明之外,还有另一种解决方法吗?

问题 #2

我已经从生成的 ServiceContract 接口中删除了所有空字符串 Actions。我现在可以检查我的 web 服务生成的 WSDL 并使用我的 .net wcf 客户端调用它。SolMan 无法调用我的 web 服务,在我的 web.config 中启用 MessageLogging 后,我发现我的服务出现故障:

<s:Fault>
    <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none" xmlns="">a:ActionNotSupported</faultcode>
    <faultstring xml:lang="en-CA" xmlns="">The message with Action '' 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>

实际上,检查 SOAP 请求消息表明,soapaction 存在于 HTTP 标头中,但为空,并且 Action 也存在于 SOAP 标头中,它也是空的。

所以我找到了一篇关于微软的 1DispatchByBodyBehavior1 示例的帖子,试了一下,并用 Fiddler 重播了 http 请求,但没有成功。我设法使其工作的唯一方法是从 Fiddler 的 SOAP 标头中删除<Action>and 。<To>SolMan 确实会继续传递这些标题。

SolMan 在调用 SOAP Web 服务时不设置任何操作是否有效?

我究竟做错了什么?

4

0 回答 0