使用WCF-WSHttp BizTalk 2010适配器调用WS-Security + SSL服务时出错

问题描述:

我正在使用BizTalk Server 2010和WCF-WSHttp适配器调用Web服务。 Web服务在HTTPS上发布,并且必须使用使用证书签名的WS-Security发送请求。使用WCF-WSHttp BizTalk 2010适配器调用WS-Security + SSL服务时出错

这些适配器配置:

常规 - >交通运输 - >类型:WCF-WSHttp

WCF-WSHttp属性:

常规 - >地址:HTTPS服务端点。

常规 - >安全 - >安全模式:TransportWithMessageCredential

常规 - >安全 - >信息安全 - >邮件客户端凭据类型:证书

常规 - >安全 - >信息安全 - > Algoritm套房:256

常规 - >安全 - >协商服务凭证:是

常规 - >安全 - >建立安全上下文:是

常规 - >安全性 - >客户端证书 - > ThumbPrint:用于签署消息的证书。

我不把任何东西放在常规选项卡的SOAP操作标题文本框中。

当我调用服务,我得到了以下错误消息:

An error occurred while processing the message, refer to the details section for more information 
Message ID: {A3234833-0453-4DCA-BB9C-7AAA9A865B90} 
Instance ID: {54417DE1-3E08-4AB4-8BE2-B5565650ECFF} 
Error Description: System.ServiceModel.ProtocolException: El tipo de contenido text/xml;charset=utf-8 del mensaje de respuesta no coincide con el tipo de contenido del enlace (application/soap+xml; charset=utf-8). Si usa un codificador personalizado, asegurese de que el método IsContentTypeSupported se implemente correctamente. Los primeros 553 bytes de la respuesta fueron: '<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Body> 
    <soapenv:Fault> 
    <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode> 
    <faultstring>no SOAPAction header!</faultstring> 
    <detail> 
    <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">zefdesw02</ns2:hostname> 
    </detail> 
    </soapenv:Fault> 
</soapenv:Body> 
</soapenv:Envelope>'. ---> System.Net.WebException: Error en el servidor remoto: (500) Error interno del servidor. 
    en System.Net.HttpWebRequest.GetResponse() 
    en System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
    --- Fin del seguimiento de la pila de la excepción interna --- 

Server stack trace: 
    en System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout) 
    en System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Security.TlsnegoTokenProvider.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    en System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout) 
    en System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    en System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    en System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) 
    en System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout) 
    en System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout) 
    en System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    en System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    en System.ServiceModel.Channels.CommunicationObject.Open() 

Exception rethrown at [0]: 
    en System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    en System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    en System.ServiceModel.ICommunicationObject.Open() 
    en Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.GetChannel[TChannel](IBaseMessage bizTalkMessage, ChannelFactory`1& cachedFactory) 
    en Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage) 

看来,远程服务器不理解SOAP客户端消息或SOAP消息没有被很好地形成(它不是不是一个SOAP消息或它没有被标记)。

有人可以帮助我吗?

+0

有关这方面的消息吗?从BizTalk调用Axis2 web服务时遇到问题... – mousio 2013-05-30 08:14:44

根据翻译,它看起来像发送的内容类型对于目标服务期望的内容不正确。看起来您正在调用Apache Axis服务,因此您可能需要构建端点行为来处理来自Apache的响应。在其他线程上,我听说有人需要自定义发送的内容,因为目标服务不是WCF。