You need to sign in to do that
Don't have an account?
cfdude
ConvertLead call gives error "Element X invalid at this location", Enterprise SOAP 22.0
Hi, I'm using ColdFusion 9.01 and the Enterprise Soap API, version 22.0. I'm trying to call the convertLead() method and I'm getting the following error.
Request sent:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <urn:SessionHeader> <urn:sessionId>(sessionid removed for clarity)</urn:sessionId> </urn:SessionHeader> </soapenv:Header> <soapenv:Body> <urn:convertLead> <urn:leadConverts> <OPPORTUNITYNAME>Joe Blow - 30 Day Trial</OPPORTUNITYNAME> <SENDNOTIFICATIONEMAIL>1</SENDNOTIFICATIONEMAIL> <CONTACTID/> <DONOTCREATEOPPORTUNITY>false</DONOTCREATEOPPORTUNITY> <LEADID>00QE0000001z3XC</LEADID> <OWNERID>005ExxxxxxxXa7hIAC</OWNERID> <OVERWRITELEADSOURCE>1</OVERWRITELEADSOURCE> <CONVERTEDSTATUS>Qualified</CONVERTEDSTATUS> <ACCOUNTID/> </urn:leadConverts> </urn:convertLead> </soapenv:Body> </soapenv:Envelope>
Response:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Element {}OPPORTUNITYNAME invalid at this location</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
The thing is, if I rearrange the leadConverts elements it will always bark at whatever the first one is. If i remove all but one, then it barks at the only remaining one. Please help. Thanks!
XML is case sensitive, try using the correct case for the element names (you can see them in the WSDL.
All Answers
XML is case sensitive, try using the correct case for the element names (you can see them in the WSDL.
Simon, thanks! That was the issue I was having. Once I changed the element names to the right case and matched the wsdl definition it worked like a charm.