When attempting to follow the WSO2 directions to update a salesforce record I am getting the following error.
Saleforce adaptor - error injecting sObjects to payload : org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '{' (code 123) in prolog; expected '<'
<?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>
I am using WSO2 EI 6.1.0 and the salesforce connector 2.0.1. The Salesforce ID TestId1 exists as does the field ValueToChange. My SalesforceLoginInfo is correct (I can do Salesforce queries, just not updates).
Attempting to solve the problem I saw this very similar question. But I've added the lines to the axis2.xml according to the Solution, restarted, and the problem still exists.
<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"/>
Does anyone know how to fix this problem? I feel like I'm just following a tutorial (my code is nearly exactly the given wso2 salesforce example) and yet the problem continues.
UPDATE: To reduce confusion about the SalesforceLoginInfo call, I removed that and put the salesforce.init in the code. The error is still the same.
<?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>