• Fluffy
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 4
    Replies
Hello,
I'm still having the problem calling describeGlobal() from java. Im using an axis 2 generated
stub with xmlbeans option. I can perform most of
the operations from the API (like logging in, executing queries, etc). However, for some reason
But I can't call the describeGlobal() function, and haven't been able to figure out why. My code is
as follows:

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
try{

SforceServiceStub stub = new SforceServiceStub();          
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
           
LoginDocument ld = LoginDocument.Factory.newInstance();
Login l = Login.Factory.newInstance();
l.setUsername("abc@def.ghi.jk");
l.setPassword("xxxx");           
ld.setLogin(l);

LoginScopeHeaderDocument lshd = LoginScopeHeaderDocument.Factory.newInstance();
LoginScopeHeader aLoginScopeHdr = LoginScopeHeader.Factory.newInstance();
lshd.setLoginScopeHeader(aLoginScopeHdr);
LoginResult lr = stub.login(ld, lshd).getLoginResponse().getResult();          
                       
stub = new SforceServiceStub(lr.getServerUrl());
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
                       
SessionHeader sh = SessionHeader.Factory.newInstance();
sh.setSessionId(lr.getSessionId());
SessionHeaderDocument sd = SessionHeaderDocument.Factory.newInstance();
sd.setSessionHeader(sh);
          
DescribeGlobalDocument dgd = DescribeGlobalDocument.Factory.newInstance();
stub.describeGlobal(dgd, sd);       
}
catch(Exception e)
{
e.printStackTrace();           
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

The login is successful, however the describeGlobal() function throws me the following exception:

org.apache.axiom.om.OMException: java.lang.IllegalStateException
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
    at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:127)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:328)
    at com.sforce.soap.enterprise.SforceServiceStub.toOM(SforceServiceStub.java:6166)
    at com.sforce.soap.enterprise.SforceServiceStub.toEnvelope(SforceServiceStub.java:6535)
    at com.sforce.soap.enterprise.SforceServiceStub.describeGlobal(SforceServiceStub.java:1855)


Can anybody please suggest what I may be doing wrong here ? Should I be setting the session header
somehow differently ?

Thanks a lot for any suggestions,
regards,

-- Fluffy

  • December 13, 2007
  • Like
  • 0
Hello,

I use salesforce Perl API and I can execute queries on
most saleforce tables (72 of them). However, there are 8
tables which I cannot query at all. These tables are: Name,
NoteAndAttachment, EmailStatus, OpenActivity,AdditionalNumber,
ProcessInstanceHistory, Approval and ActivityHistory.

When these same tables are queried with Perl API the following error
is generated:

INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting
  • December 11, 2007
  • Like
  • 0
Hello,

I use java salesforce API and axis 2 , and stubs generated with xmlbeans option. I can execute queries on
most saleforce tables (72 of them). However, there are 8 tables which I cannot query
at all. These tables are: Name, NoteAndAttachment, EmailStatus,
OpenActivity,AdditionalNumber,ProcessInstanceHistory, Approval and ActivityHistory.

Whenever I try to query any of these tables with the API, I get the following exception:

<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><meta name="GENERATOR" content="OpenOffice.org 2.1 (Linux)"><meta name="AUTHOR" content="yana millis"><meta name="CREATED" content="20071210;9342400"><meta name="CHANGEDBY" content="yana millis"><meta name="CHANGED" content="20071210;12505100"> com.sforce.soap.enterprise.UnexpectedErrorFaultException: UnexpectedErrorFaultException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303 at
com.sforce.soap.enterprise.SforceServiceStub.query(
SforceServiceStub.java:4257)


When these same tables are queried with Perl API a more descriptive error is generated:
INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables may not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting

  • December 10, 2007
  • Like
  • 0
   
Hello,

I use java and axis 2 , and stubs generated with xmlbeans option. I can execute queries on
most saleforce tables (72 of them). However, there are 8 tables which I cannot query
at all. These tables are: Name, NoteAndAttachment, EmailStatus,
OpenActivity,AdditionalNumber,ProcessInstanceHistory, Approval and ActivityHistory.

Whenever I try to query any of these tables with the API, I get the following exception:

<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><meta name="GENERATOR" content="OpenOffice.org 2.1 (Linux)"><meta name="AUTHOR" content="yana millis"><meta name="CREATED" content="20071210;9342400"><meta name="CHANGEDBY" content="yana millis"><meta name="CHANGED" content="20071210;12505100"> com.sforce.soap.enterprise.UnexpectedErrorFaultException: UnexpectedErrorFaultException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303 at
com.sforce.soap.enterprise.SforceServiceStub.query(
SforceServiceStub.java:4257)


When these same tables are queried with Perl API a more descriptive error is generated:
INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have an ideas why do these tables may not support
queries ?

Thanks ahead for any suggestions,
regards,

--Fluffy


  • December 10, 2007
  • Like
  • 0
Hello !
I'm currently trying to make a local copy of our salesforce db. The basic approach i'v adopted
so far is query each and every table and dump the data in local postgresql db.
I use java, axis 2 and stub was generated with xmlbeans option.
I am able to query most of the tables (74 of them). However, there are several tables which I can't
query for some reason . The API exception I'm getting when trying to run queries on these tables
are not very descriptive. For instance, when running the query
"Select Id from Name"

the API throws the following exception:

com.sforce.soap.enterprise.UnexpectedErrorFaultException: UnexpectedErrorFaultException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at com.sforce.soap.enterprise.SforceServiceStub.query(SforceServiceStub.java:4257)


I'm totally at loss here. I've looked in my wsdl file, and the definition of the Name
object is there. Moreover, I can call the describe() function on Name , and it returns
all the correct fields of the Name table. Does anybody have any idea why I'm unable
to query this table ? Can it have anything to do with the way my wsdl was generated
or something ?
Any suggestions would be grrreatly appreciated ! :0)

regards,
--Fluffy
  • December 10, 2007
  • Like
  • 0
Hello,

I'm using Java, and an axis 2 generated stub with xmlbeans option. I can perform most of
the operations from the API (like logging in, executing queries, etc). However, for some reason
I can't call the describeGlobal() function, and haven't been able to figure out why. My code is
as follows:

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
try{

SforceServiceStub stub = new SforceServiceStub();          
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
           
LoginDocument ld = LoginDocument.Factory.newInstance();
Login l = Login.Factory.newInstance();
l.setUsername("abc@def.ghi.jk");
l.setPassword("xxxx");           
ld.setLogin(l);

LoginScopeHeaderDocument lshd = LoginScopeHeaderDocument.Factory.newInstance();
LoginScopeHeader aLoginScopeHdr = LoginScopeHeader.Factory.newInstance();
lshd.setLoginScopeHeader(aLoginScopeHdr);
LoginResult lr = stub.login(ld, lshd).getLoginResponse().getResult();          
                       
stub = new SforceServiceStub(lr.getServerUrl());
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
                       
SessionHeader sh = SessionHeader.Factory.newInstance();
sh.setSessionId(lr.getSessionId());
SessionHeaderDocument sd = SessionHeaderDocument.Factory.newInstance();
sd.setSessionHeader(sh);
          
DescribeGlobalDocument dgd = DescribeGlobalDocument.Factory.newInstance();
stub.describeGlobal(dgd, sd);       
}
catch(Exception e)
{
e.printStackTrace();           
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

The login is successful, however the describeGlobal() function throws me the following exception:

org.apache.axiom.om.OMException: java.lang.IllegalStateException
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
    at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:127)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:328)
    at com.sforce.soap.enterprise.SforceServiceStub.toOM(SforceServiceStub.java:6166)
    at com.sforce.soap.enterprise.SforceServiceStub.toEnvelope(SforceServiceStub.java:6535)
    at com.sforce.soap.enterprise.SforceServiceStub.describeGlobal(SforceServiceStub.java:1855)


Can anybody please suggest what I may be doing wrong here ? Should I be setting the session header
somehow differently ?

Thanks a lot for any suggestions,
regards,

-- Fluffy



  • December 10, 2007
  • Like
  • 0
Hello, I am using axis 2 and having a problem executing queries from my Java code. I have generated the SforceServiceStub.java from the wsdl file, and I am able to connect to the salesforce service successfully (i.e. I can get the server URL, and a session ID). Moreover, the describeGlobal()
function runs great, and returns all the object types. However, when trying to execute a basic
query, I'm getting this error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.lang.RuntimeException: Unsupported type urn:sobject.enterprise.soap.sforce.com Contact
at com.sforce.soap.enterprise.SforceServiceStub$ExtensionMapper.getTypeObject(SforceServiceStub.java:25165)
at com.sforce.soap.enterprise.SforceServiceStub$SObject$Factory.parse(SforceServiceStub.java:16678)
at com.sforce.soap.enterprise.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:21263) at  com.sforce.soap.enterprise.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:40935)
at com.sforce.soap.enterprise.SforceServiceStub.fromOM(SforceServiceStub.java:25016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

my code is as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class SampleLogin {    
   
    public static void main(String args[])  {      
     
            SforceServiceStub stub = new SforceServiceStub();
            Options options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);

            Login lg = new Login();
            lg.setPassword("********");
            lg.setUsername("*******");
            LoginScopeHeader lsh = null;         
            LoginResponse response = stub.login(lg, lsh);
            LoginResult lr  = response.getResult();
                    
            SessionHeader sh = new SessionHeader();
            sh.setSessionId(lr.getSessionId());          
            stub = new SforceServiceStub(lr.getServerUrl());
            options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
          
           QueryOptions qOptions = new QueryOptions();
            qOptions.setBatchSize(200);          
            Query q = new Query();
            q.setQueryString("select AccountId from Contact");
            QueryResponse qResponse = stub.query(q, sh, qOptions, null);          
            QueryResult qr = qResponse.getResult();
 }
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can anyone please suggest what  I may be doing wrong, and point in the right direction ?

Thanks a bunch ahead,
:0)
--Fluffy 

  • October 27, 2007
  • Like
  • 0
 
Hello, I am having a problem executing queries from my Java code. I have generated the SforceServiceStub.java from the wsdl file, and I am able to connect to the salesforce server successfully. Moreover, the describeGlobal()
function runs great, and returns all the object types. However, when executing
queries, I'm getting the error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.lang.RuntimeException: Unsupported type urn:sobject.enterprise.soap.sforce.com Contact
at com.sforce.soap.enterprise.SforceServiceStub$ExtensionMapper.getTypeObject(SforceServiceStub.java:25165)
at com.sforce.soap.enterprise.SforceServiceStub$SObject$Factory.parse(SforceServiceStub.java:16678)
at com.sforce.soap.enterprise.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:21263) at  com.sforce.soap.enterprise.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:40935)
at com.sforce.soap.enterprise.SforceServiceStub.fromOM(SforceServiceStub.java:25016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

my code is as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class SampleLogin {    
   
    public static void main(String args[])  {      
     
            SforceServiceStub stub = new SforceServiceStub();
            Options options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);

            Login lg = new Login();
            lg.setPassword("********");
            lg.setUsername("*******");
            LoginScopeHeader lsh = null;         
            LoginResponse response = stub.login(lg, lsh);
            LoginResult lr  = response.getResult();
                    
            SessionHeader sh = new SessionHeader();
            sh.setSessionId(lr.getSessionId());          
            stub = new SforceServiceStub(lr.getServerUrl());
            options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
          
           QueryOptions qOptions = new QueryOptions();
            qOptions.setBatchSize(200);          
            Query q = new Query();
            q.setQueryString("select AccountId from Contact");
            QueryResponse qResponse = stub.query(q, sh, qOptions, null);          
            QueryResult qr = qResponse.getResult();
 }
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can anyone suggest what am I doing wrong, and point in the right direction ?

Thanks a bunch ahead,
:0)
--Fluffy
  • October 26, 2007
  • Like
  • 0
   
Hello, I am having a problem executing queries from my Java code. I have generated the SforceServiceStub.java from the wsdl file, and I am able to connect to the salesforce server successfully. Moreover, the describeGlobal()
function runs great, and returns all the object types. However, when executing
queries, I'm getting the error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.lang.RuntimeException: Unsupported type urn:sobject.enterprise.soap.sforce.com Contact
at com.sforce.soap.enterprise.SforceServiceStub$ExtensionMapper.getTypeObject(SforceServiceStub.java:25165)
at com.sforce.soap.enterprise.SforceServiceStub$SObject$Factory.parse(SforceServiceStub.java:16678)
at com.sforce.soap.enterprise.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:21263) at  com.sforce.soap.enterprise.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:40935)
at com.sforce.soap.enterprise.SforceServiceStub.fromOM(SforceServiceStub.java:25016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

my code is as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class SampleLogin {    
   
    public static void main(String args[])  {      
     
            SforceServiceStub stub = new SforceServiceStub();
            Options options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);

            Login lg = new Login();
            lg.setPassword("********");
            lg.setUsername("*******");
            LoginScopeHeader lsh = null;         
            LoginResponse response = stub.login(lg, lsh);
            LoginResult lr  = response.getResult();
                    
            SessionHeader sh = new SessionHeader();
            sh.setSessionId(lr.getSessionId());          
            stub = new SforceServiceStub(lr.getServerUrl());
            options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
          
           QueryOptions qOptions = new QueryOptions();
            qOptions.setBatchSize(200);          
            Query q = new Query();
            q.setQueryString("select AccountId from Contact");
            QueryResponse qResponse = stub.query(q, sh, qOptions, null);          
            QueryResult qr = qResponse.getResult();
 }
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can anyone suggest what am I doing wrong, and point in the right direction ?

Thanks a bunch ahead,
:0)
--Fluffy 





  • October 26, 2007
  • Like
  • 0
Hello,

I use salesforce Perl API and I can execute queries on
most saleforce tables (72 of them). However, there are 8
tables which I cannot query at all. These tables are: Name,
NoteAndAttachment, EmailStatus, OpenActivity,AdditionalNumber,
ProcessInstanceHistory, Approval and ActivityHistory.

When these same tables are queried with Perl API the following error
is generated:

INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting
  • December 11, 2007
  • Like
  • 0
Hello,

I use java salesforce API and axis 2 , and stubs generated with xmlbeans option. I can execute queries on
most saleforce tables (72 of them). However, there are 8 tables which I cannot query
at all. These tables are: Name, NoteAndAttachment, EmailStatus,
OpenActivity,AdditionalNumber,ProcessInstanceHistory, Approval and ActivityHistory.

Whenever I try to query any of these tables with the API, I get the following exception:

<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><meta name="GENERATOR" content="OpenOffice.org 2.1 (Linux)"><meta name="AUTHOR" content="yana millis"><meta name="CREATED" content="20071210;9342400"><meta name="CHANGEDBY" content="yana millis"><meta name="CHANGED" content="20071210;12505100"> com.sforce.soap.enterprise.UnexpectedErrorFaultException: UnexpectedErrorFaultException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303 at
com.sforce.soap.enterprise.SforceServiceStub.query(
SforceServiceStub.java:4257)


When these same tables are queried with Perl API a more descriptive error is generated:
INVALID_TYPE_FOR_OPERATION: entity type does not support query

Its worth pointing out that these entities ARE in the wsdl file,
and they ARE being referenced by other tables, and I CAN call
describe() on them from the API, and all the correct fields and their
types are returned..

So, does anybody have any ideas why do these tables may not support
queries ? And what could I possibly do to debug this matter ?

Thanks ahead for any suggestions,


--Fluffy

PS. Apologies for cross-posting

  • December 10, 2007
  • Like
  • 0
Hello, I am using axis 2 and having a problem executing queries from my Java code. I have generated the SforceServiceStub.java from the wsdl file, and I am able to connect to the salesforce service successfully (i.e. I can get the server URL, and a session ID). Moreover, the describeGlobal()
function runs great, and returns all the object types. However, when trying to execute a basic
query, I'm getting this error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.lang.RuntimeException: Unsupported type urn:sobject.enterprise.soap.sforce.com Contact
at com.sforce.soap.enterprise.SforceServiceStub$ExtensionMapper.getTypeObject(SforceServiceStub.java:25165)
at com.sforce.soap.enterprise.SforceServiceStub$SObject$Factory.parse(SforceServiceStub.java:16678)
at com.sforce.soap.enterprise.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:21263) at  com.sforce.soap.enterprise.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:40935)
at com.sforce.soap.enterprise.SforceServiceStub.fromOM(SforceServiceStub.java:25016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

my code is as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class SampleLogin {    
   
    public static void main(String args[])  {      
     
            SforceServiceStub stub = new SforceServiceStub();
            Options options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);

            Login lg = new Login();
            lg.setPassword("********");
            lg.setUsername("*******");
            LoginScopeHeader lsh = null;         
            LoginResponse response = stub.login(lg, lsh);
            LoginResult lr  = response.getResult();
                    
            SessionHeader sh = new SessionHeader();
            sh.setSessionId(lr.getSessionId());          
            stub = new SforceServiceStub(lr.getServerUrl());
            options = stub._getServiceClient().getOptions();
            options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
            options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
          
           QueryOptions qOptions = new QueryOptions();
            qOptions.setBatchSize(200);          
            Query q = new Query();
            q.setQueryString("select AccountId from Contact");
            QueryResponse qResponse = stub.query(q, sh, qOptions, null);          
            QueryResult qr = qResponse.getResult();
 }
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can anyone please suggest what  I may be doing wrong, and point in the right direction ?

Thanks a bunch ahead,
:0)
--Fluffy 

  • October 27, 2007
  • Like
  • 0