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
java devjava dev 

Not able to query custom objects - Invalid element in com.sforce.soap.enterprise.sobject.SObject

Hi there,
   I am trying to query custom objects 'Quote'. I am using the enterprise WSDL.
a) The query runs from the SForce explorer and returns the results.
b) I am able to get the metadata for the object 'SFDC_520_Quote__c'.
c) The following java code throws an exception
 
qr = binding.query("select Id, opportunity__c from SFDC_520_Quote__c");
Exception:
Sep 18, 2006 5:30:22 PM org.apache.axis.client.Call invoke
SEVERE: Exception:
org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - Opportunity__c
 at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
 at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
 ...
Am I missing something or is there a bug? Please help.
 
Sudheer
 
      
SuperfellSuperfell
You need to download your latest WSDL and regenerate your stubs.
java devjava dev
Hi Cheers, Thanks for Your Valuable Reply,,,,
 
 
But I have already regenrated my wsdl & compiled that after adding 'Quote' App.
After that only iam getting the exception that i have mentioned in my Issue.
 
So please give me suggestions for this ....
Sudheer Tumu
SuperfellSuperfell
The exceptions says that the response includes an Opportunity__c, but that's not in the WSDL you've compiled with. Either you have an old WSDL, or you didn't rebuild the stubs, or the stubs its using at runtime are not the ones you think its using.
java devjava dev

HI Cheers ,

No cheers I am using the new Generated WSDL file & the stubs Iam using are also genertaed from that new file only.I am able to get metadata of

"SFDC_520_Quote__c" Object using.

DescribeSObjectResult[] describeSObjectResults = binding.describeSObjects(new String[] {"SFDC_520_Quote__c"});

 But iam not able to query that object.

So please help me ...

Sudheer Tumu