我正在將WSO2 ESB 4.8.1與SFDC集成。與SFDC的Wso2 ESB集成
使用SFDC連接器1.0
在WSO2我所編寫的代碼<salesforce.logout/>
,根據WSO2文檔他們說,它關閉當前連接。
<salesforce.logout/>
產生下面是我在WSO2 ESB日誌
TID: [0] [ESB] [2016-08-30 07:55:39,442] DEBUG {org.apache.synapse.transport.http.wire} - << "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"><soapenv:Header><urn:SessionHeader><urn:sessionId>00D17000000BPGr!AQcAQDIggW.ikXtsb0Ckm8c8pKKDlF_8QN42jL31WUa6hDLOdEeNIjrYsevKW0FeZLDzlrjcDLwMni_7gYaZgNfdN4zv9Cgj</urn:sessionId></urn:SessionHeader></soapenv:Header><soapenv:Body><urn:logout></urn:logout></soapenv:Body></soapenv:Envelope>[\r][\n]" {org.apache.synapse.transport.http.wire}
確定SOAP消息,但幾次我得到以下錯誤(INVALID_SESSION_ID AM:無效的會話ID在SessionHeader發現:非法的會話的會話沒有找到,缺少會話哈希:)時<salesforce.logout/>
執行
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} - >> "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_SESSION_ID</faultcode><faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: je59etMAEPM+m9VdYJb0AW==[\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} - >> "This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </faultstring><detail><sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>INVALID_SESSION_ID</sf:exceptionCode><sf:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: je59etMAEPM+m9VdYJb0AW==[\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} - >> "This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </sf:exceptionMessage></sf:UnexpectedErrorFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>[\r][\n]" {org.apache.synapse.transport.http.wire}
它是SFDC問題/ WSO2 SFDC連接器問題/ WSO2 ESB配置問題。
對於更新插入操作,我們使用configkey屬性在整個項目中,下面是代碼
<salesforce.upsert configKey="sfdc_connection_dtls">
<allOrNone>0</allOrNone>
<allowFieldTruncate>0</allowFieldTruncate>
<sobjects xmlns:sfdc="sfdc">{//sfdc:sObjects}</sobjects>
</salesforce.upsert>
所以,當我在各自的順序使用<salesforce.logout/>
,不是僅關閉當前連接,也就是按順序使用。 ?或者關閉所有現有的連接。
我在哪裏使用salesforce.upsert(以下是框架代碼),我可以在salesforce.upsert調用後使用<salesforce.logout/>
。
<salesforce.upsert configKey="sfdc_connection_dtls">
<!-- sobject goes here -->
</salesforce.upsert>
期待您的幫助
感謝, Tejas的