我正在使用 BizTalk Server 2010 和 WCF-WSHttp 适配器调用 Web 服务。Web 服务在 HTTPS 上发布,并且必须使用带有证书的 WS-Security 发送请求。
这些是适配器配置:
常规 -> 传输 -> 类型:WCF-WSHttp
WCF-WSHttp 属性:
常规 -> 地址:https 服务端点。
常规 -> 安全 -> 安全模式:TransportWithMessageCredential
常规 -> 安全 -> 消息安全 -> 消息客户端凭据类型:证书
常规 -> 安全 -> 消息安全 -> 算法套件:256
常规 -> 安全 -> 协商服务凭证:是
常规 -> 安全 -> 建立安全上下文:是
常规 -> 安全 -> 客户端证书 -> ThumbPrint:用于签署消息的证书。
我没有在 General 选项卡的 SOAP Action Header 文本框中放置任何内容。
当我调用该服务时,我收到以下错误消息:
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 消息或未签名)。
有人可以帮助我吗?