You need to sign in to do that
Don't have an account?
VP
SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - type
I am running a query with enterprise api as follows:
qr = binding.query("select id from "+objName+ " where Name = '"+objInstanceNameValue+"'");
objName=Account and objInstanceNameValue has an account value.
I am getting the error:
18312 [main] ERROR org.apache.axis.client.Call - Exception:
org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - type
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
What could be the problem?
qr = binding.query("select id from "+objName+ " where Name = '"+objInstanceNameValue+"'");
objName=Account and objInstanceNameValue has an account value.
I am getting the error:
18312 [main] ERROR org.apache.axis.client.Call - Exception:
org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - type
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
What could be the problem?
What is the ServerURL of the enterprise WSDL?
loginResult.serverUrl= "https://eu0-api.salesforce.com/services/Soap/c/7.0" ?
Thanks, Andi
To resolve (if you are using enterprise WSDL/endpoint) - not only do you need to import the new object's definition into your WSDL, you also need to update the qName section of your com.sforce.soap.enterprise.SoapBindingStub class to reference this new SObject type. Looks something like this:
If you don't update SoapBindingStub class - you will still be able to query the new SObject, but no fields except the ID field. For any other fields, you will get the following error:
org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - Custom_Field__c