尝试按照WSO2 directions更新salesforce记录时,出现以下错误。WSO2 ESB:使用Salesforce连接器时发生意外字符错误
Saleforce适配器 - 误差注入sObjects到有效载荷:org.apache.axiom.om.OMException:com.ctc.wstx.exc.WstxUnexpectedCharException:在序言意外字符 '{'(代码123);预计 '<'
<?xml version="1.0" encoding="UTF-8"?>
<proxy
xmlns="http://ws.apache.org/ns/synapse"
xmlns:sfdc="sfdc" name="SalesforceUpdateTest" startOnLoad="true" statistics="enable" trace="enable" transports="http,https">
<target>
<inSequence>
<sequence key="conf:/SalesforceLoginInfo"/>
<payloadFactory>
<format>
<sfdc:sObjects
xmlns:sfdc="sfdc" type="Account">
<sfdc:sObject>
<sfdc:Id>TestId1</sfdc:Id>
<sfdc:ValueToChange>Yes</sfdc:ValueToChange>
</sfdc:sObject>
</sfdc:sObjects>
</format>
<args/>
</payloadFactory>
<salesforce.update>
<allOrNone>0</allOrNone>
<allowFieldTruncate>0</allowFieldTruncate>
<sobjects
xmlns:sfdc="sfdc">{//sfdc:sObjects}
</sobjects>
</salesforce.update>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
我使用WSO2 EI 6.1.0和Salesforce的连接器2.0.1。 Salesforce ID TestId1与ValueToChange字段一样存在。我的SalesforceLoginInfo是正确的(我可以做Salesforce查询,只是没有更新)。
试图解决这个问题,我看到这个问题very similar。但是我已经根据解决方案将这些行添加到了axis2.xml的,重新启动,问题仍然存在。
<messageBuilder contentType="application/json" class="org.wso2.carbon.integrator.core.json.JsonStreamBuilder"/>
<messageBuilder contentType="text/javascript" class="org.wso2.carbon.integrator.core.json.JsonStreamBuilder"/>
<messageFormatter contentType="application/json" class="org.wso2.carbon.integrator.core.json.JsonStreamFormatter"/>
<messageFormatter contentType="text/javascript" class="org.wso2.carbon.integrator.core.json.JsonStreamFormatter"/>
有谁知道如何解决这个问题?我觉得我只是遵循一个教程(我的代码几乎就是给定的wso2 salesforce示例),但问题仍然存在。
更新:为了减少有关SalesforceLoginInfo调用的混淆,我删除了该代码并将salesforce.init放入代码中。错误仍然是一样的。
<?xml version="1.0" encoding="UTF-8"?>
<proxy
xmlns="http://ws.apache.org/ns/synapse"
xmlns:sfdc="sfdc" name="SalesforceUpdateTest" startOnLoad="true" statistics="enable" trace="enable" transports="http,https">
<target>
<inSequence>
<salesforce.init>
<username>[email protected]</username>
<password>mypasswordandmytoken</password>
<loginUrl>https://test.salesforce.com/services/Soap/u/27.0</loginUrl>
<blocking>true</blocking>
</salesforce.init>
<payloadFactory>
<format>
<sfdc:sObjects
xmlns:sfdc="sfdc" type="Account">
<sfdc:sObject>
<sfdc:Id>TestId1</sfdc:Id>
<sfdc:ValueToChange>Yes</sfdc:ValueToChange>
</sfdc:sObject>
</sfdc:sObjects>
</format>
<args/>
</payloadFactory>
<salesforce.update>
<allOrNone>0</allOrNone>
<allowFieldTruncate>0</allowFieldTruncate>
<sobjects
xmlns:sfdc="sfdc">{//sfdc:sObjects}
</sobjects>
</salesforce.update>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
嗨..这ESB的版本使用? –
更新了问题。 wso2ei-6.1.0是我为esb安装的。 Salesforce连接器是salesforce-connector-2.0.1 –
嗨..如何在不使用凭据的情况下调用端点?你错过了这个https://docs.wso2.com/display/ESBCONNECTORS/Configuring+Salesforce+Connector+Operations – Hariprasath