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
thintonthinton 

querying for custom objects

Hi,
 
I am having an issue when attempting to query for data from a custom object that I created. I am appending the '__c' to the end of it. The error is:
 
There is an error in XML document (1, 388).
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader) at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ASPSample.sforce.SforceService.query(String queryString) at ASPSample.BuildList.populateListsDropDown() at ASPSample.BuildList.Page_Load(Object sender, EventArgs e)
 
I can query just fine for non-custom objects and for custom fields in non-custom objects. My custom object shows up when I call DescribeGlobal. I am not attempting to do anything with the results, I am merely calling the query. Any ideas? <meta content="Microsoft Visual Studio .NET 7.1" name=GENERATOR> <meta content=C# name=CODE_LANGUAGE> <meta content=JavaScript name=vs_defaultClientScript> <meta content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema>
SuperfellSuperfell
Did you download a new enterprise WSDL and update your project. Its likely that you're accessing a custom object that was added after the WSDL you're using was generated.

In general you should not do metadata driven (i.e. using the various describe calls) programs with the enterprise WSDL because you can run into these sorts of issues.
thintonthinton

Couple of questions:

How can I still query for custom fields?

And how do I generate a new wsdl?

SuperfellSuperfell
The partner API doesn't suffer from these WSDL problems for metadata driven applications.

You can download a current WSDL from the app (setup -> integrate)