设置mustUnderstand =" 0"在WCF发送适配器中 [英] Set mustUnderstand="0" in WCF Send Adapter

查看:85
本文介绍了设置mustUnderstand =" 0"在WCF发送适配器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须调用WebService(基于Java并且无法在服务器端更改任何内容......)


我们使用带有WCF自定义适配器和WCF的发送端口-BasicHttp Binding。


发送端口返回以下错误:


System.ServiceModel.Security.MessageSecurityException:从另一方收到了一个不安全或不正确安全的故障。请参阅内部FaultException以获取故障代码和详细信息。 --->
System.ServiceModel.FaultException: MustUnderstand标题:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity不理解-secext-1.0.xsd}安全性


   ---内部异常堆栈跟踪结束---


BizTalk发送适配器创建的SOAP信封包含以下内容:


< o:安全
s:mustUnderstand =" 1"
xmlns:o =" http:/ /docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd ">


WebService的提供者告诉我们,我们只需删除"mustUnderstand"或将其更改为
0 "


问题:我们如何更改或删除'mustUnderstand'?


其他信息:


我们尝试使用WCF-WSHttp绑定但是由于内容类型错误导致错误...

解决方案

首先,这不是BizTalk Server,WCF,您或者你的应用。 问题是服务器端的...... 可疑实现 .... 也许您根本不应该向他们发送Security头?


如果您必须更改值以适应其实现,您将使用自定义WCF行为来修改MustUnserstand属性安全标题。


https://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapheader.mustunderstand(v = vs.110).aspx


We have to call a WebService (Java based and no chance to change anything on the server side …)

We use a Send Port with WCF-Custom Adapter and WCF-BasicHttp Binding.

The Send Port returns the following Error:

System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood

   --- End of inner exception stack trace ---

The SOAP Envelope created by the BizTalk Send Adapter contains the following:

<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

The provider of the WebService told us that we just have to remove the "mustUnderstand" or change it to s:mustUnderstand="0"

Question: How can we change or remove the ‘mustUnderstand’?

Additional Info:

We tried to use WCF-WSHttp Binding but this brought an Error because of a wrong Content Type …

解决方案

First, this is not a problem with BizTalk Server, WCF, you or your app.  The problem is the...questionable implementation...of the server side.  Maybe you shouldn't be sending them the Security header at all?

If you must change the value to accommodate their implementation, you would use a custom WCF Behavior to modify the MustUnserstand Property of the Security Header.

https://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapheader.mustunderstand(v=vs.110).aspx


这篇关于设置mustUnderstand =&quot; 0&quot;在WCF发送适配器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆