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

时间:2017-01-23 18:44:13

标签: web-services salesforce mule soapui

我正在尝试使用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

RAW REQUEST

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)

RAW RESPONSE

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>

1 个答案:

答案 0 :(得分:1)

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