SAP 解决方案管理器调用 WCF Web 服务时的空肥皂操作
上下文:
SAP Solution Manager(将称为 SolMan)公开了一个 SOAP Web 服务,第三方可以调用该服务来与其进行互操作。第 3 方应用程序还可以实现相同的 Web 服务接口,以便 SolMan 可以在另一个方向上进行互操作。 我需要与 SolMan 进行双向互操作。我的 Web 服务是一个 WCF 服务,基于使用 VS2010“添加服务引用”从 SolMan Web 服务的 WSDL 生成的接口和类型。
问题#1
在 WSDL 中,所有声明的操作都有soapAction=""。当VS2010生成服务契约接口时,所有OperationContractAttribute都是Action="",ReplyAction="*"。由于多个OperationContract具有相同的Action(空字符串),因此Web服务不起作用,例外情况是:
[InvalidOperationException:操作 AcceptIncidentProcessing 和AddInfo有相同的action()。每个操作都必须有一个 独特的行动价值。]
这正常吗?除了从生成的 ServiceContract 接口中删除所有 Action="" 声明之外,还有另一种方法可以修复它吗?
问题#2
我已从生成的 ServiceContract 接口中删除了所有空字符串操作。 我现在可以检查由我的 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 标头中,并且它也是空的。
因此,我找到了一篇关于 Microsoft 的 1DispatchByBodyBehavior1 示例的帖子,尝试了一下,并使用 Fiddler 重播了 http 请求,但没有成功。我设法使其工作的唯一方法是从 Fiddler 的 SOAP 标头中删除
和
。 SolMan 确实会继续传递这些标头。
SolMan 在调用 SOAP Web 服务时不设置 Action 是否有效?
我做错了什么?
Context :
SAP Solution Manager (will call it SolMan) exposes a SOAP webservice where a 3rd party can call to interoperate with it. The 3rd party application can also implement the same webservice interface so that SolMan can interoperate in the other direction.
I need to interoperate with SolMan in both directions. My webservice is a WCF Service based on the interface and the types generated from the WSDL of the SolMan webservice with VS2010 "Add Service reference".
Problem #1
In the WSDL, all of the declared operations has soapAction="". When the service contract interface has been generated from VS2010, all OperationContractAttribute are Action="", ReplyAction="*". Since more than one OperationContract has the same Action (empty string), the Webservice doesn't work, the exception is :
[InvalidOperationException: The operations AcceptIncidentProcessing
and AddInfo have the same action (). Every operation must have a
unique action value.]
Is this normal? There is another way to fix it other than removing all Action="" declarations from the generated ServiceContract interface?
Problem #2
I've removed all empty string Actions from the generated ServiceContract interface.
I can now inspect the WSDL generated by my webservice and call it with my .net wcf client.
SolMan is unable to call my webservice, after enabling MessageLogging in my web.config, I found that my service has faulted with :
<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>
Indeed inspecting the SOAP request message shows that soapaction is present in the HTTP Headers, but empty, and that Action is also presents in the SOAP headers and it is also empty .
So I found a Post about the Microsoft's 1DispatchByBodyBehavior1 sample, gave it a try and replayed the http request with Fiddler wihout success. The only way I manage to make it work, is by removing the <Action>
and <To>
from the SOAP headers in Fiddler. SolMan will indeed continue to pass these headers.
Is it valid that SolMan sets no Action when calling a SOAP webservice?
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论