function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kirill_YunussovKirill_Yunussov 

org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - Name

For some reason I cannot query any fields other than ID via API for a few recently created custom objects.   I am using Entersprise WSDL, and a simple  query of "select id, name from my_custom_object__c".

 

The result is this error:  org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - Name

 

 

If I try to pull only the ID, then there are no issues.  

 

I have checked the permissions for this new object, and there seems to be no problems there - visible to all.

 

 

Best Answer chosen by Kirill_Yunussov
Kirill_YunussovKirill_Yunussov
Need to update the definition of SoapBindingStub.java in the WSDL - it has references to all classes.

All Answers

merthenmerthen

Agree with Kirill, something must have just recently changed in SFDC.  If I create a new custom object, consume the new wsdl using wsdl2java then query any field other than the ID, I get the same error. 

However, querying older, existing, custom objects, everything still works.

Kirill_YunussovKirill_Yunussov

We have resolved this issue, although it's still not very clear what the root cause was.  As it turned out, there was an error in the WSDL that we generated via wsdl2java.   wsdl2java was timing out half way through its process, and creating an incomplete WSDL while not showing an error.  To fix the timeout issue, we added "-O -1" flag to the command line invocation (batch file), which disables the timeouts.   

Kirill_YunussovKirill_Yunussov
Need to update the definition of SoapBindingStub.java in the WSDL - it has references to all classes.
This was selected as the best answer