• codeWarrior
  • NEWBIE
  • 5 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies

The question really is: How to go about deconstructing and extracting data from a QueryResult which is totally based on a custom object ?

Is there a general technique for manually deserializing a QueryResult where the entire query result comes from an SForce custom-object ? Any advice or samples would be appreciated...

I am looking for some general guidance / guidelines on how to extract the name / value pairs (roughly the SFDC equivalent of columns and values) from a query result.

Is SObject.get_any() [indice].getValue() probably the best mechanism available ?

The main issue being -- I am retrieving the contents of a 100% custom object (all of the fields end with '__c') using the Partner 6.0 API without a WSDL.

There is a reason for not using a WSDL -- We don't necessarily know the structure of the custom object - (it may have been further customized by a client) - So I am first retrieving the structure of the custom object with a call to DescribeSObject:

    DescribeSObjectResult dsor = binding.describeSObject(objs[h]);
    Field[] fields = dsor.getFields();

// Then extracting the field names...

if (fields != null) {

    String fieldnames[] = new String[fields.length];

     // Iterate through the fields to get properties for each field
     for (int i = 0; i < fields.length; i++) {

           fieldnames[i] = fields.getName();
      
      }

}

// Then -- based on the field list -- generate a dynamic SOQL query by joining the field names

String SOQL = "SELECT " + join(", ", fieldnames) + FROM " + dsor.getName() + "");

QueryResult qr = this.binding.query(SOQL);

 

 

 

 

 

 

 

Is this what I think it is ?

- Exception: org.xml.sax.SAXException: No deserializer for {urn:sobject.enterprise.soap.sforce.com}dmsf_employee__c

Is this caused by the fact that my Partner WSDL doesn't line up with my custom objects in SFDC or because I am trying to select the "Id" column in my SOQL statement ?

SELECT Middle_Name__c, SystemModstamp, First_Name__c, Home_Postal_Code__c, Accounting_Market_Segment__c, Department__c, Office_Fax__c, Last_Name__c, Home_City__c, Primary_Language__c, Payments_Hold__c, Leave_Reason_Description__c, Home_State__c, Office_Email_Address__c, Title__c, Employee_ID__c, OwnerId, Active__c, LastModifiedById, Secondary_Language__c, Birthday__c, End_Date__c, Payroll_ID__c, CreatedDate, Start_Date__c, LastModifiedDate, Home_Country__c, Home_Phone__c, Name, Office_Location__c, Leave_Reason__c, Mobil_Phone__c, Accounting_Department_Number__c, Gender__c, Home_Fax__c, Suffix__c, Job_Title__c, Initials__c, Office_Phone__c, Home_Street__c, Accounting_Region_Code__c, Role__c, Home_Email_Address__c, Id, Accounting_Country_Code__c, CreatedById FROM dmsf_employee__c

 

Does SFDC run a web-service that I can connect to to retrieve WSDL "on-the-fly" ?
Any ideas why this would stop working ?

JDK1.4.2.08
SF API 6.0
Partner WSDL


this.binding = (SoapBindingStub) new SforceServiceLocator().getSoap(new java.net.URL(sfurl));

where sfurl={!API_Enterprise_Server_URL_60}

Any information on what information I can get back about the binding or why it fails would be appreciated....


TIA...

Message Edited by codeWarrior on 10-25-2005 04:06 PM

Message Edited by codeWarrior on 10-25-2005 04:06 PM

Message Edited by codeWarrior on 10-25-2005 04:06 PM

I am getting the following error messages while trying to import my enterprise.wsdl file:

 

init:
wscompile-init:
SFDCServices_wscompile:
command line: wscompile C:\Java\j2sdk1.4.2_08\jre\bin\java.exe -classpath "C:\Java\j2sdk1.4.2_08\lib\tools.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\j2ee.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\saaj-api.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\saaj-impl.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\jaxrpc-api.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\jaxrpc-impl.jar;C:\Java\j2sdk1.4.2_08\lib\bsh-2.0b4.jar;C:\Java\j2sdk1.4.2_08\lib\postgresql-8.0-312.jdbc3.jar;C:\sforce\axis_1.1\lib\axis-ant.jar;C:\sforce\axis_1.1\lib\axis.jar;C:\sforce\axis_1.1\lib\commons-discovery.jar;C:\sforce\axis_1.1\lib\commons-logging.jar;C:\sforce\axis_1.1\lib\log4j-1.2.8.jar;C:\sforce\axis_1.1\lib\saaj.jar;C:\sforce\axis_1.1\lib\wsdl4j.jar;C:\sforce\axis_1.1\lib\jaxrpc.jar;C:\Java\jswdp-1.6\jaxrpc\lib\jaxrpc-api.jar;C:\Java\jswdp-1.6\jaxrpc\lib\jaxrpc-impl.jar;C:\Java\jswdp-1.6\jaxrpc\lib\jaxrpc-spi.jar;C:\Java\axis-1_2\lib\wsdl4j-1.5.1.jar;C:\Java\axis-1_2\lib\axis-ant.jar;C:\Java\axis-1_2\lib\activation.jar;C:\Java\axis-1_2\lib\axis.jar;C:\Java\axis-1_2\lib\commons-discovery-0.2.jar;C:\Java\axis-1_2\lib\commons-httpclient-3.0-rc2.jar;C:\Java\axis-1_2\lib\commons-logging-1.0.4.jar;C:\Java\axis-1_2\lib\jaxrpc.jar;C:\Java\axis-1_2\lib\log4j-1.2.8.jar;C:\Java\axis-1_2\lib\mailapi_1_3_1.jar;C:\Java\axis-1_2\lib\saaj.jar;C:\Java\axis-1_2\lib\servlet.jar;C:\Java\axis-1_2\lib\xercesImpl.jar;C:\Java\axis-1_2\lib\xmlParserAPIs.jar" com.sun.xml.rpc.tools.wscompile.Main -d C:\WEBROOT\dforce-NB4.1\build\generated\wsbinary -features:wsi,strict -import -keep -mapping C:\WEBROOT\dforce-NB4.1\web\WEB-INF\SFDCServices-mapping.xml -nd C:\WEBROOT\dforce-NB4.1\build\web\WEB-INF\wsdl -s C:\WEBROOT\dforce-NB4.1\src -verbose -Xprintstacktrace C:\WEBROOT\dforce-NB4.1\src\sfdc\SFDCServices-config.xml
modeler error: found unexpected non whitespace text: "-"
        at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModelerBase.buildModel(WSDLModelerBase.java:276)
        at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
        at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
        at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
        at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
        at com.sun.xml.rpc.tools.wscompile.Main.main(Main.java:22)

CAUSE:

found unexpected non whitespace text: "-"
        at com.sun.xml.rpc.wsdl.parser.Util.fail(Util.java:152)
        at com.sun.xml.rpc.wsdl.parser.Util.nextElement(Util.java:110)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseTypes(WSDLParser.java:1185)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLParser.java:447)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLParser.java:380)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLParser.java:335)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.java:225)
        at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:214)
        at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModelerBase.buildModel(WSDLModelerBase.java:200)
        at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
        at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
        at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
        at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
        at com.sun.xml.rpc.tools.wscompile.Main.main(Main.java:22)
error: modeler error: found unexpected non whitespace text: "-"
C:\WEBROOT\dforce-NB4.1\nbproject\build-impl.xml:235: wscompile failed

 

Any suggestions ???