Wso2 ESB与SFDC集成

时间:2016-08-30 17:27:58

标签: wso2 wso2esb sfdc

我正在将WSO2 ESB 4.8.1与SFDC集成。

使用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}

但很少次我遇到错误 (INVALID_SESSION_ID:在SessionHeader中找到无效的会话ID:非法会话。未找到会话,缺少会话哈希:) 当{{ 1}}被执行

<salesforce.logout/>

是SFDC问题/ WSO2 SFDC连接器问题/ WSO2 ESB配置问题。?

对于upsert操作,我们在整个项目中使用configkey属性,下面是代码

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}

因此,当我在相应的序列中使用<salesforce.upsert configKey="sfdc_connection_dtls">           <allOrNone>0</allOrNone>           <allowFieldTruncate>0</allowFieldTruncate>           <sobjects xmlns:sfdc="sfdc">{//sfdc:sObjects}</sobjects>         </salesforce.upsert> 时,它是否仅关闭按顺序可用的当前连接。或者它关闭所有存在的连接。?

无论我在哪里使用salesforce.upsert(下面是框架代码),我都可以在salesforce.upsert调用后使用<salesforce.logout/>

<salesforce.logout/>

期待您的帮助

谢谢, 特加斯

1 个答案:

答案 0 :(得分:1)

在WSO2 SFDC连接器中,每个初始化配置的每个流都创建了一个SF连接。因此,如果您发出注销,则后续请求将失败。没有必要发出注销,因为无论如何都要在流程结束时终止连接。