将 Mule 连接到 Salesforce 基于 SOAP 的 Web 服务



我正在尝试使用Web Service Consumer将MuleSfot连接到基于Salesforce SOAP的Web服务。首先尝试在 SOAPUI 中但INVALID_SESSION_ID,我需要登录 Salesforce 以获取 ID 但不清楚。请帮忙!!

编辑 1

我正在发送的请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:="http://soap.sforce.com/schemas/class/WebService">
   <soapenv:Header>
      <AllowFieldTruncationHeader>
         <allowFieldTruncation>false</allowFieldTruncation>
      </AllowFieldTruncationHeader>
      <DebuggingHeader>
         <!--Zero or more repetitions:-->
         <categories>
            <category>All</category>
            <level>None</level>
         </categories>
         <debugLevel>None</debugLevel>
      </DebuggingHeader>
      <CallOptions>
         <client>?</client>
      </CallOptions>
      <SessionHeader>
         <sessionId>?</sessionId>
      </SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
   </soapenv:Body>
</soapenv:Envelope>

? 对于客户端来说很好。这是我无法获得的会话ID

原始请求

POST https://cs61.salesforce.com/services/Soap/class/WebService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 972
Host: cs61.salesforce.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

原始响应

HTTP/1.1 500 Server Error
Date: Tue, 24 Jan 2017 04:18:15 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: reflected-xss block;report-uri /_/ContentDomainCSPNoAuth?type=xss
Content-Security-Policy: referrer origin-when-cross-origin
Set-Cookie: BrowserId=CdHsqmLzR3OFRklUfp1p3g;Path=/;Domain=.salesforce.com;Expires=Sat, 25-Mar-2017 04:18:15 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked

    <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="http://soap.sforce.com/schemas/class/WebService">
<soapenv:Body>
<soapenv:Fault>
<faultcode>sf:INVALID_SESSION_ID</faultcode>
<faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

我明白了。需要先登录到 Salesforce,使用 login() 调用并获取会话 ID。谢谢

最新更新