SOAP 发送适配器

使用 SOAP 发送适配器调用 Web 服务。 SOAP 发送适配器读取 BizTalk Message 对象上的消息上下文,以获取代理名称并调用关联的外部 Web 服务代理。

SOAP 发送适配器的客户端身份验证

SOAP 发送适配器使用以下身份验证类型之一向目标服务器进行身份验证:

  • 匿名。 默认设置。

  • 基本。 SOAP 连接以纯文本形式发送用户名和密码。

  • 消化。 SOAP 连接以加密格式发送用户名和密码。

  • Kerberos 或 NTLM。 用户名和密码都不会通过 SOAP 连接发送。 SOAP 适配器始终使用运行 SOAP 发送适配器的进程凭据进行身份验证。

    此外,如果服务器需要或接受客户端安全套接字层(SSL)证书,SOAP 发送适配器还可以向 Web 服务器提供客户端安全套接字层(SSL) 证书。

    如果启用了 Enterprise Single Sign-On (SSO),则当 SOAP 发送适配器收到一条消息并请求 SSOTicket 属性时,适配器将连接到 SSO 服务器以验证和兑换票证。 SOAP 适配器验证票证后,会解密该票证,并从凭据存储中检索关联系统的凭据。 然后,SOAP 适配器使用凭据连接到关联系统,并处理 SOAP 请求。

SOAP 发送适配器的客户端证书

SOAP 发送适配器可以建立与接受或要求客户端证书的服务器建立安全连接。 如果指定客户端证书,SOAP 发送适配器在与需要或接受客户端证书的服务器连接时使用证书。 如果未指定客户端证书,目标服务器需要客户端证书,SOAP 发送适配器将无法发送消息,并遵循标准重试逻辑。

SOAP 发送适配器使用 BizTalk Server 进程所在帐户的个人证书库中的客户端证书。 SOAP 适配器按指纹指定证书。 如果 SOAP 发送适配器因任何原因无法加载证书,则会暂停发送的消息。

否定确认(NACK)消息由 HTTP 或 SOAP 适配器为失败的传输生成。

成功传输消息后,如果启用了传递通知,BizTalk 消息引擎会将关联的确认 (ACK) 消息发布到 MessageBox 数据库。 同样,当 BizTalk 消息传递引擎挂起消息或编排引擎挂起编排时,BizTalk Server 会将关联的负确认(NACK)消息发布到 MessageBox。 NACK 消息包含上下文属性和包含 SOAP 错误的消息正文部分。 如果由于来自 HTTP 或 SOAP 适配器的传输失败而生成 NACK 消息,则 SOAP 错误包含来自目标 Web 服务器的响应的 Headers 元素和 Body 元素。 下面是为失败的 SOAP 传输生成的 NACK 中的 SOAP 错误示例:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  
   <SOAP:Body>  
      <SOAP:Fault>  
         <faultcode>Microsoft BizTalk Server Negative Acknowledgment</faultcode>   
         <faultstring>An error occurred while processing the message, refer to the details section for more information</faultstring>   
         <faultactor>http://localhost/receivestandard.asp</faultactor>   
         <detail>  
            <ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd">  
            <NAckID>{4E646707-03AA-4493-95C7-A64B09E2987D}</NAckID>  
            <ErrorCode>0x80131600</ErrorCode>  
            <ErrorCategory>0</ErrorCategory>  
            <ErrorDescription>The remote server returned an error: (404) Not Found.</ErrorDescription>  
            <ErrorDetail>  
            <HttpErrorDetail xmlns="http://schema.microsoft.com/BizTalk/2006/HttpErrorDetails.xsd">  
               <Headers>Server: Microsoft-IIS/5.1 Date: Wed, 21 Apr 2005 00:27:47 GMT X-Powered-By: ASP.NET Connection: close Content-Type: text/html Content-Length: 67 </Headers>  
               <Body>We could not locate the page you requested. Please check the URL.</Body>  
            </HttpErrorDetail>  
            </ErrorDetail>  
            </ns0:NACK>  
         </detail>  
      </SOAP:Fault>  
   </SOAP:Body>  
</SOAP:Envelope>  

注释

Headers 元素和 Body 元素限制为 48 KB。 Headers 元素将舍入为最接近的完整标头值对,而不会超出限制。 Body 元素截断为 48 KB。

注释

如果没有匹配的订阅,则丢弃 NACK 和 ACK 消息。 消息引擎不会挂起 NACK 和 ACK 消息。

若要订阅 NACK 消息,可以执行以下作之一:

  1. 使用相应的消息上下文属性的筛选器创建发送端口。 有关系统消息上下文属性(包括与消息确认相关的属性)的列表,请参阅 UI 指南中的消息上下文属性开发人员 API 命名空间参考

  2. 从标记为 传递通知 = 已传输 的业务流程端口发送。 如果编排端口标记为 传递通知 = 传输,则编排将等待,直到收到已传输消息的 ACK 或 NACK。 如果生成了 NACK,它会被导向编排系统,编排系统将引发 DeliveryFailureException。 DeliveryFailureException 是从 NACK 消息正文所包含的 SOAP 错误中反序列化得到的。 若要从返回到业务流程的 SOAP 错误中检索异常消息字符串,请将 DeliveryFailureException 强制转换为 SoapException,然后从 SOAP 详细信息部分访问 InnerXml。 以下代码示例演示如何执行此作:

    // Cast the DeliveryFailureException to a SoapException…  
    System.Web.Services.Protocols.SoapException se = (System.Web.Services.Protocols.SoapException)e.InnerException;  
    System.Diagnostics.Trace.WriteLine(se.Detail.InnerXml);  
    //e is an Microsoft.XLANGs.BaseTypes.DeliveryFailureException  
    //object type created in an Exception handler  
    

    上面的代码示例将返回如下所示的 XML 片段:

    <ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd">  
    <NAckID>{4E646707-03AA-4493-95C7-A64B09E2987D}</NAckID>  
    <ErrorCode>0x80131600</ErrorCode>  
    <ErrorCategory>0</ErrorCategory>  
    <ErrorDescription>The remote server returned an error: (404) Not Found.</ErrorDescription>  
    <ErrorDetail>  
    <HttpErrorDetail xmlns="http://schema.microsoft.com/BizTalk/2006/HttpErrorDetails.xsd">  
       <Headers>Server: Microsoft-IIS/5.1 Date: Wed, 21 Apr 2005 00:27:47 GMT X-Powered-By: ASP.NET Connection: close Content-Type: text/html Content-Length: 67 </Headers>  
       <Body>We could not locate the page you requested. Please check the URL.</Body>  
    </HttpErrorDetail>  
    </ErrorDetail>  
    </ns0:NACK>  
    

另请参阅

什么是 SOAP 适配器?
SOAP 适配器安全建议