使用BizTalk发送文档遇SOAPAction HTTP头不识别异常排查
BizTalk发送文档时SOAPAction HTTP头异常问题解析
问题场景
使用BizTalk发送指定XML文档时,触发如下SOAP异常:
异常信息:
System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://tempuri.org/GetResponse.
发送的XML文档内容:
<?xml version="1.0" encoding="utf-8"?> <Envelope> <Header> <Interface>Request_Doc_Submission_MOTrans_in</Interface> <NoOfRecords>1</NoOfRecords> </Header> <Body> <Message> <DocSubmission_InFile> <DocSubmission_InFile_Header> <CustomerID>18</CustomerID> <File_name>MOTrans_DocSubmission_In_19062024_1288.xml</File_name> <Ordinal_Number>1288</Ordinal_Number> <File_Creation_Date>19062024 20:08:58</File_Creation_Date> <Total_Records>1</Total_Records> </DocSubmission_InFile_Header> <DocSubmissionRequests> <DocSubmissionRequestData> <InitialDocumentID>ff4f3c9d-5e2e-ef11-a30e-00505695ca63</InitialDocumentID> <CaseDisplayIdentifier>27310-06-24</CaseDisplayIdentifier> <DocumentOriginName>ff4f3c9d-5e2e-ef11-a30e-00505695ca63.pdf</DocumentOriginName> </DocSubmissionRequestData> </DocSubmissionRequests> </DocSubmission_InFile> </Message> </Body> </Envelope>
问题原因
HTTP请求头中的SOAPAction取值错误:
http://tempuri.org/GetResponse是.NET Web服务框架生成的默认临时命名空间+操作名,并非目标服务实际期望的取值。- XML文档中明确指定了接口为
Request_Doc_Submission_MOTrans_in,但SOAPAction却使用了通用的临时值,导致目标服务无法识别该请求对应的操作。
解决方法
获取正确的SOAPAction值
找到目标Web服务的WSDL文档,定位到Request_Doc_Submission_MOTrans_in对应的操作节点,查看<soap:operation>元素的soapAction属性值,这就是服务期望的正确SOAPAction。修改BizTalk发送端口配置
- 打开BizTalk发送端口的属性窗口。
- 在SOAP传输配置项中,找到SOAPAction设置项。
- 将当前的
http://tempuri.org/GetResponse替换为从WSDL中获取的正确值。
检查映射/管道配置
如果SOAPAction是通过BizTalk映射或自定义管道组件动态设置的,需确保逻辑中传入的是与Request_Doc_Submission_MOTrans_in匹配的正确SOAPAction值。
内容的提问来源于stack exchange,提问作者Nikk Carrel
相关产品推荐
相关产品推荐

