我正在与内部系统集成。我在一个对象上设置了传出消息,每次更新记录时,我的Web服务都会看到该消息。我的服务正在发送一个真实的响应,但是传出的消息传递状态显示“SOAP响应是一个nack”。
我使用wireshark在我的网络服务器上捕获请求和响应。这就是我所看到的:
请求:
<?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>
有人能看到导致响应失败的原因吗?
答案 0 :(得分: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名称空间中的事实。