0

我正在与内部系统集成。我已经在一个对象上设置了一条传出消息,并且每次更新记录时我的 Web 服务都会看到该消息。我的服务正在发送一个真实的响应,但传出的消息传递状态显示“SOAP 响应是一个 nack”。

我使用wireshark 在我的Web 服务器上捕获请求和响应。这就是我所看到的:

要求:

<?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>
  <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
   <OrganizationId>00D00000000hfNqEAI</OrganizationId>
   <ActionId>04k370000004FsYAAU</ActionId>
   <SessionId xsi:nil="true"/>
   <EnterpriseUrl>https://na31.salesforce.com/services/Soap/c/36.0/00D00000000hfNq</EnterpriseUrl>
   <PartnerUrl>https://na31.salesforce.com/services/Soap/u/36.0/00D00000000hfNq</PartnerUrl>
   <Notification>
    <Id>04l370000006ISGAA2</Id>
    <sObject xsi:type="sf:Opportunity" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
     <sf:Id>00637000007h5uwAAA</sf:Id>
     <sf:AccountId>00100000003Qy45AAC</sf:AccountId>
     <sf:Name>Andrew Test</sf:Name>
     <sf:OwnerId>00500000006pE7kAAE</sf:OwnerId>
     <sf:StageName>Unqualified</sf:StageName>
    </sObject>
   </Notification>
  </notifications>
 </soapenv:Body>
</soapenv:Envelope>

响应:(HTTP/1.1 200 OK)

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-NV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.sforce.com/2005/09/outbound"><SOAP-ENV:Body><Ack>true</Ack></SOAP-ENV:Body></SOAP-ENV:Envelope>

谁能看到导致响应失败的原因?

4

1 回答 1

1

您的响应消息不符合 WSDL 描述的格式,它应该是

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
   <notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">
     <Ack>true</Ack>
   </notificationsResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

请注意附加的 notificationsResponse 元素,以及它位于 OM xml 命名空间中的事实。

于 2016-03-04T05:50:53.697 回答