You need to sign in to do that
Don't have an account?
Enterprice XML Web Service request issues
Trying to mess around with the Enterprise API and I can't seem to get my XML request setup correctly.
Here is my XML update request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"> <soapenv:Header> <urn:SessionHeader> <urn:sessionId>tricks</urn:sessionId> </urn:SessionHeader> </soapenv:Header> <soapenv:Body> <urn:update> <urn:sObjects xsi:type="urn1:Account"> <urn1:Id>0015000000Lij8E</urn1:Id> <Name>test</Name> </urn:sObjects> </urn:update> </soapenv:Body> </soapenv:Envelope>
And here is the response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Client</faultcode> <faultstring>The prefix "xsi" for attribute "xsi:type" associated with an element type "urn:sObjects" is not bound.</faultstring> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
What am I messing up? I was using this as a guideline but it is very old and may be outdated: http://wiki.developerforce.com/index.php/Enterprise_Update
Thanks,
Jason
did you try adding:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
to your envelope?
All Answers
did you try adding:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
to your envelope?
You are missing a namespace defintion for xsi:
Try this:
xmlns:xsi="http://www.w3.org/2001/XMLSchema "
Thanks Joe, perfect!
You missed defining the namespace for xsi. You use:
xsi:type="urn1:Account"
But never said what that meant. At the top of the request, add to the top element something like:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
This will define the namespace and allow you to continue.