You need to sign in to do that
Don't have an account?
Getting a general error(0) on a batch update using SOAP
Hey DevAngel!
I am having trouble with a batch update. Here is the soap request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Header>
<headerStruct>
<session_id xsi:type="xsd:string">g1IZodnymEdPbz.RjxCwsmH4wGeI6ygXsruXndS3cwNZZoI_J4af7jwNuh9x1rTi_ek7G0Mnsvzbe5lYbeG83vbtzKggVlhL</session_id>
<version xsi:type="xsd:string">2</version>
</headerStruct>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<qry1:batch xmlns:qry1="sfconnector:SalesforceConnector" type="methodCall">
<type xsi:type="xsd:string">account</type>
<operation xsi:type="xsd:string">update</operation>
<arguments href="#id1"/>
<soapenc:Array id="id1" soapenc:arrayType="xsd:anyType[1]">
<Item href="#2"/>
</soapenc:Array>
<soapenc:Array id="2" soapenc:arrayType="tns:mapEntry[2]">
<Item href="#2A"/>
<Item href="#2B"/>
</soapenc:Array>
<tns:mapEntry id="2A" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">cf_00N30000000c27H</key>
<name xsi:type="xsd:double">0</name>
</tns:mapEntry>
<tns:mapEntry id="2B" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">id</key>
<name xsi:type="xsd:string">000000000000000</name>
</tns:mapEntry>
</qry1:batch>
</soap:Body>
</soap:Envelope>
Also, I am trying to generate an error response from the server in the above xml.
Thanx!
Hi Jay,
Here is a sample batch soap request that works. It would be nice to know what the response looks like from your request. ID of all zeroes is definitiely not valid though.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<tns:headerStruct id="h_id1">
<session_id xsi:type="xsd:string">YggXamXL9Xo7yWVwl7g0J7NNgrcGhHSO3DeiQwWOhtNQePTXCBTSfqePi0JK3F1WlhesH4MTJhbnk1kfkBIVRfbtzKggVlhL</session_id>
<version xsi:type="xsd:string">2.0</version>
<client xsi:type="xsd:string">generic</client>
</tns:headerStruct>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:batch xmlns:q1="sfconnector:SalesforceConnector">
<type xsi:type="xsd:string">account</type>
<operation xsi:type="xsd:string">insert</operation>
<arguments href="#id1" />
</q1:batch>
<soapenc:Array id="id1" soapenc:arrayType="xsd:anyType[3]">
<Item href="#id2" />
<Item href="#id3" />
<Item href="#id4" />
</soapenc:Array>
<soapenc:Array id="id2" soapenc:arrayType="tns:mapEntry[2]">
<Item href="#id5" />
<Item href="#id6" />
</soapenc:Array>
<soapenc:Array id="id3" soapenc:arrayType="tns:mapEntry[2]">
<Item href="#id7" />
<Item href="#id8" />
</soapenc:Array>
<soapenc:Array id="id4" soapenc:arrayType="tns:mapEntry[2]">
<Item href="#id9" />
<Item href="#id10" />
</soapenc:Array>
<tns:mapEntry id="id5" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">newaccount 1</value>
</tns:mapEntry>
<tns:mapEntry id="id6" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">url</key>
<value xsi:type="xsd:string">www.url1.com</value>
</tns:mapEntry>
<tns:mapEntry id="id7" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">newaccount 2</value>
</tns:mapEntry>
<tns:mapEntry id="id8" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">url</key>
<value xsi:type="xsd:string">www.url2.com</value>
</tns:mapEntry>
<tns:mapEntry id="id9" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">newaccount 3</value>
</tns:mapEntry>
<tns:mapEntry id="id10" xsi:type="tns:mapEntry">
<key xsi:type="xsd:string">url</key>
<value xsi:type="xsd:string">www.url3.com</value>
</tns:mapEntry>
</soap:Body>
</soap:Envelope>
DevAngel,
I know that an id of all zeros is not valid, i'm trying to just to see if my syntax is correct. I should receive a standard "batch" error code.
So, here is the fault response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header/><soap:Body><soap:Fault><faultcode>0</faultcode><faultstring></faultstring></soap:Fault></soap:Body></soap:Envelope>
Thanx
DevAngel,
I found the problem in my XML key-value pairs I had key-name.
So, my bad.
Thanx, for you assistance!