• Milan
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 20
    Replies
Hello,

Recently we have seen a number of errors such as the following in our logs:

Invalid Session ID found in SessionHeader: Illegal Session

Our app integrates with SalesForce AppExchange. From what I've read, this error may mean that the user's SalesForce session has expired, although they may still be able to interact with our application in the AppEx frameset. This seems to make some sense in that the point in the user's experience where we are seeing this error is during checkout, which means that it may be possible for them to have been using the app long enough for their Sales Force session to expire.

Does this error really indicate that the user's SalesForce session has expired and, if so, is there something I can do through integration to help keep it alive or re-initialize it? How do other people deal with this issue?
  • April 09, 2008
  • Like
  • 0
Hello,
 
We plan to retrieve assignment rules using Salesforce API. The rules are retrieved so that when we insert new leads, we also pass the assignment rules that should be simultaneously triggered. we are developing using Java.
 
The query to retrieve assignment rule is as follows:
 

Select Id,Name From AssignmentRule

 
This seems to retrieve ALL the assignment rules. What we are interested is ONLY the assignment rules of LEADS. What should our query be ?
 
Thanks and regards,
Milan
 
 
  • August 23, 2007
  • Like
  • 0
Hello,
 
I had a simple Query to be fired. The query is as follows :
 
Select LastName,Company,PostalCode from lead where lastName = 'SomeLastName' and ...
 
The response that I recieve I parse as follows :
Code:
// Select LastName, Company , PostalCode from lead where
String lastName = fields[0].getValue();
String companyName = fields[1].getValue();
String scf = fields[2].getValue();

 However to my great sirprise the XML response that I had recieved was as follows :
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
      <soapenv:Body>
         <queryResponse>
            <result>
               <ns1:done>true</ns1:done>
               <ns1:queryLocator xsi:nil="true"/>
               <ns1:records xsi:type="sf:Lead">
                  <sf:Company>Catholic Health Initiatives</sf:Company>
                  <sf:LastName>Peach</sf:LastName>
                  <sf:PostalCode>802</sf:PostalCode>
               </ns1:records>
               <ns1:records xsi:type="sf:Lead">
                  <sf:Company>Catholic Health Initiatives</sf:Company>
                  <sf:LastName>Martin</sf:LastName>
                  <sf:PostalCode>802</sf:PostalCode>
               </ns1:records>

 
i.e the company is first and the lastName is after the Company Name . Now, that takes my code up for a toss.... :)
 
I was preeety sure that I had seen retrieving the values based on position in some of the Salesforce doc. But anyways, does it mean that retrieving values like :
 
String lastName = fields[0].getValue();
String companyName = fields[1].getValue();
 
is NOT THE RIGHT WAY TO DO THINGS ???
 
I guess, I should be retrieving values based on ElementNames...
 
BTW, is this anything to do with Partner API vis-a-vis Enterprise API. My guess is, and only a guess, I was not having this issue as long as I was using the partner API but I think its more evident in Enterprise API. Is it ?
 
Anyways, what would be the right approach to retrieve values ?
 
Any feedback appreciated.
 
Thanks,
Milan
 
  • July 17, 2007
  • Like
  • 0
Hello,
 
Our app is supposed to use Enterprise API and has been coded accordingly. In development and test, I would login using the Enterprise URL and use the subsequent Session Id and server URL returned to make subsequent calls. No problem there.
 
In real worlkd scenario, our app will be working as a tab in Salesforce and people will NOT be login in AGAIN to come to our functionality. We will directly recieve their server URL and session Id. We will than invoke the getUserInfo to retrieve information and identify as to who the user is, etc, etc and proceed.
 
My only question is how do I ensure that I am hitting a URL which is an Enterprise URL ? In my test , since I was manually login in to Enterprise URL , I assume that the serverURL returned by Salesforce will be an enterpriseURL. But in the real world scenario, when the user comes in, he directly passes a Server URL and Session ID, how do I know that the server URL is an Enterprise URL ?
 
Any insights will be appreciated.
 
Thanks,
Milan
  • July 17, 2007
  • Like
  • 0
Hi,

 

We are trying to come up with an Application which will directly insert leads into those Salesforce user's who are interested in getting them. Thus we will actually insert leads into different user's account. As part of the lead insertion we want to pass our custom defined field data ? How would we do that ?

 

e.g: We want to pass a custom defined field called Custom__c along with other lead information fields. Now, since the different Salesforce users will naturally not have that field(and few more such fields), how will that work ?


Hope my question is clear enough.Any inputs will be appreciated,
Thanks,
Milan
  • May 18, 2007
  • Like
  • 0
Hello,
 
I need to create Leads using API. During creation, it may have AssignmentRules, based on certain business logic. My simple question :
 
For those leads which do NOT have an assignmentRule, do I :
  1. Set the useDefaultRule to true ? OR
  2. Do not pass the AssignmentRuleHeader itself in the SOAPHeader .

Which one is the correct way to do ? Or is 1 and 2 the same ?

Thanks,

Milan

  • May 17, 2007
  • Like
  • 0
Hello,
 
In our application, we need to verify if a lead already exists, before we insert (create) a new one. One of the ways we are going to check for existing leads is based on email. i.e If a Lead with a certain email id already exists, it means it need not be inserted (created) again.
 
Now, we may have to insert thousands of leads at a time. Which in turn means verifying all those thousands of leads before we insert them. What is the best possible approach, keeping time in mind, to do this ? Note : Time is critical !
 
One approach that immediately comes to my mind is using a Query in Partner WSDL and passing a batch of say n email Ids at a time. i.e:
 
 qr = stub.query("select email, FirstName, LastName, Id from Contact where email IN ('abc@asd.com', 'werr@dfdf.com' ,'cxvcv@uoa.edu','dfdf.fd@wer.com', 'fd@abc.com' ,...........)");    
   
  1. Would this be a good idea ?
  2. It is never a great idea to fire a 'like' query in existing production database... so do I have a better option ?
  3. Firing a single call for each lead certainly seems a slower option ... isnt it ?

Thus can anyone suggest what is the best practice for such a scenario ?

Thanks,

Milan

  • May 07, 2007
  • Like
  • 0
Hello,
 
We are supposed to Create leads / contacts in Salesforce using Partner WSDL. There may be times when we will be creating more than 5000 leads. So we will be invoking multiple creates (depending upon the batch size).
 
Now, if there is any error in any one of the subsequent calls. How can I rollback the earlier data that was inserted into Salesforce ?
 
I tried searching the docs and also some old postings on the forum and it seems that this feature is not available... :( I hope I am wrong .
 
Thanks,
Milan
  • May 04, 2007
  • Like
  • 0
Hello Friends,
 
I was all set to be coding with Partner WSDL files and using create to create new Leads . Then suddenly someone turned my attention towards Apex Data Loader. I want to know expert opinion on :
 

1.       Can Data loader be triggered from a Web Application (Server side) ?

 

2.       Can Data Loader be used to insert leads into a different company ? i.e Something what we would have done using create and Partner wsdl . I would NOT be having password of the user, but in partner wasdl, sine I have the session id and the server URL I can create a lead in someone else’s account!Is that possible using Data loader ? (I hope I have been able to express myself what I actually mean when I say someone else’s account).

 

3.       The  amount of records that I plan to insert is around 200 to 20000 (max) with an average of around 1000. Should I still opt for Data loader (if at all answer to the above to question is Yes).

 

Thanks for any inputs,I am not sure if wsdl or data loader is the right way...

Regards,

Milan

  • May 04, 2007
  • Like
  • 0
Hello,
 
I am firing a Query to retrieve some information. Its a simple test program to query contacts within Salesforce.
 
I am setting the Batch Size to 3 (just to understand implementation of batch size in Salesforce and to test that its inline with my understanding)
 
Code:
QueryResult qr = null;
QueryOptions qo = new QueryOptions();
qo.setBatchSize(new Integer(3));
stub.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), 
       "QueryOptions", qo);

 
The request generated is as follows, which is inline with my expectations :
Code:
POST /services/Soap/u/9.0 HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.3
Host: na4-api.salesforce.com:7002
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 929

<—xml version="1.0" encoding="UTF-8"–>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header>
         <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:partner.soap.sforce.com">
            <ns1:sessionId>X.MdpH69QhJuMTs_qEfCdx6CSsJX4ZRKqCwcDq.pR5m2hGyVaHTcsZgDQeW2z0Ihc8MDAV3oO2w_73lxBWwnG.PffGIt.5WPRX.tUakNGDXyQV6RAJI=</ns1:sessionId>
         </ns1:SessionHeader>
         <ns2:QueryOptions soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns2="urn:partner.soap.sforce.com">
            <ns2:batchSize>3</ns2:batchSize>
         </ns2:QueryOptions>
      </soapenv:Header>
      <soapenv:Body>
         <query xmlns="urn:partner.soap.sforce.com">
            <queryString>select email, FirstName, LastName, Id from Contact</queryString>
         </query>
      </soapenv:Body>
   </soapenv:Envelope>

 
The response recieved is as follows:
Code:
Server: 
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 4225
Date: Thu, 03 May 2007 17:53:44 GMT

<—xml version="1.0" encoding="UTF-8"–>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.partner.soap.sforce.com">
      <soapenv:Body>
         <queryResponse>
            <result xsi:type="QueryResult">
               <done>true</done>
               <queryLocator xsi:nil="true"/>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYskAAF</sf:Id>
                  <sf:Email>j.davis@expressl&amp;t.net</sf:Email>
                  <sf:FirstName>Josh</sf:FirstName>
                  <sf:LastName>Davis</sf:LastName>
                  <sf:Id>0036000000OsYskAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYslAAF</sf:Id>
                  <sf:Email>jane_gray@uoa.edu</sf:Email>
                  <sf:FirstName>Jane</sf:FirstName>
                  <sf:LastName>Grey</sf:LastName>
                  <sf:Id>0036000000OsYslAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsnAAF</sf:Id>
                  <sf:Email>agreen@uog.com</sf:Email>
                  <sf:FirstName>Avi</sf:FirstName>
                  <sf:LastName>Green</sf:LastName>
                  <sf:Id>0036000000OsYsnAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsoAAF</sf:Id>
                  <sf:Email>spavlova@uog.com</sf:Email>
                  <sf:FirstName>Stella</sf:FirstName>
                  <sf:LastName>Pavlova</sf:LastName>
                  <sf:Id>0036000000OsYsoAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYspAAF</sf:Id>
                  <sf:Email>lboyle@uog.com</sf:Email>
                  <sf:FirstName>Lauren</sf:FirstName>
                  <sf:LastName>Boyle</sf:LastName>
                  <sf:Id>0036000000OsYspAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsqAAF</sf:Id>
                  <sf:Email>ajames@uog.com</sf:Email>
                  <sf:FirstName>Ashley</sf:FirstName>
                  <sf:LastName>James</sf:LastName>
                  <sf:Id>0036000000OsYsqAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsrAAF</sf:Id>
                  <sf:Email>tripley@uog.com</sf:Email>
                  <sf:FirstName>Tom</sf:FirstName>
                  <sf:LastName>Ripley</sf:LastName>
                  <sf:Id>0036000000OsYsrAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsYAAV</sf:Id>
                  <sf:Email>ldcruz@uog.com</sf:Email>
                  <sf:FirstName>Liz</sf:FirstName>
                  <sf:LastName>D&apos;Cruz</sf:LastName>
                  <sf:Id>0036000000OsYsYAAV</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsZAAV</sf:Id>
                  <sf:Email>efrank@genepoint.com</sf:Email>
                  <sf:FirstName>Edna</sf:FirstName>
                  <sf:LastName>Frank</sf:LastName>
                  <sf:Id>0036000000OsYsZAAV</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYscAAF</sf:Id>
                  <sf:Email>rose@edge.com</sf:Email>
                  <sf:FirstName>Rose</sf:FirstName>
                  <sf:LastName>Gonzalez</sf:LastName>
                  <sf:Id>0036000000OsYscAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsdAAF</sf:Id>
                  <sf:Email>sean@edge.com</sf:Email>
                  <sf:FirstName>Sean</sf:FirstName>
                  <sf:LastName>Forbes</sf:LastName>
                  <sf:Id>0036000000OsYsdAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYseAAF</sf:Id>
                  <sf:Email>jrogers@burlington.com</sf:Email>
                  <sf:FirstName>Jack</sf:FirstName>
                  <sf:LastName>Rogers</sf:LastName>
                  <sf:Id>0036000000OsYseAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYshAAF</sf:Id>
                  <sf:Email>barr_tim@grandhotels.com</sf:Email>
                  <sf:FirstName>Tim</sf:FirstName>
                  <sf:LastName>Barr</sf:LastName>
                  <sf:Id>0036000000OsYshAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsiAAF</sf:Id>
                  <sf:Email>bond_john@grandhotels.com</sf:Email>
                  <sf:FirstName>John</sf:FirstName>
                  <sf:LastName>Bond</sf:LastName>
                  <sf:Id>0036000000OsYsiAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsjAAF</sf:Id>
                  <sf:Email>b.levy@expressl&amp;t.net</sf:Email>
                  <sf:FirstName>Babara</sf:FirstName>
                  <sf:LastName>Levy</sf:LastName>
                  <sf:Id>0036000000OsYsjAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OtG86AAF</sf:Id>
                  <sf:Email xsi:nil="true"/>
                  <sf:FirstName>Joe</sf:FirstName>
                  <sf:LastName>Blow</sf:LastName>
                  <sf:Id>0036000000OtG86AAF</sf:Id>
               </records>
               <size>16</size>
            </result>
         </queryResponse>
      </soapenv:Body>
   </soapenv:Envelope>

 
I am not sure why did i recieve ALL 16 contatcs at one go... I was expecting ONLY three contacts to be returned as my batch size is 3. Should it not have been so ? I read somewhere about default to 250 or 500 or so but if I am explicitely setting it to some value (3 in this case), why does it return me everything ?
 
My guess is that something is wrong in my interpretation of batchSize and any insight will be appreciated.
 
Thanks and regards,
Milan
  • May 03, 2007
  • Like
  • 0
Hello Friends,
 
I tried seeing many posts on INVALID_TYPE: Must send a concrete entity type but I am still confused and still havent been able to rectify my code. So I am posting my issue here.
 
I am trying to CREATE a Lead using PARTNER API. The steps followed are as follows:
  1. Login and retrieve the Server URL and Session ID. (This works)
  2. Set the new Session ID and use the retrieveed Server URL from step 1 above to make subsequent call for getUserInfo( ) . (This one works too, which means I am pointing to the right URL and have the session ID set correctly in the header)
  3. Try to create a Lead with the code snippet as follows:

Code:

              SObject[] sObject = new SObject[1];
  MessageElement[] lead = new MessageElement[5];
  lead[0] = new MessageElement(new QName("FirstName"),"Joe");
  lead[1] = new MessageElement(new QName("LastName"),"Doe");
  lead[2] = new MessageElement(new QName("Company"),"John Doe Inc");
  lead[3] = new MessageElement(new QName("Email"),"johndoe@jdoe.com");
  lead[4] = new MessageElement(new QName("Phone"),"4156832669");
  sObject[0] = new SObject();
  sObject[0].setType("Lead");
  sObject[0].set_any(lead);
         SaveResult[] sr = null;
         try {
            sr = stub.create(sObject);
         } catch (Exception ex) {
            System.out.println("An unexpected error has occurred." + ex.getMessage());
           return;
         }


 
I get the following error :

An unexpected error has occurred.INVALID_TYPE: Must send a concrete entity type.

I am using PARTNER API. Any clue what should I do ?Thanks for any insight.

Regards,

Milan

  • May 02, 2007
  • Like
  • 0
Hi,
 
We're testing our in-house appexchange version of our app within salesforce.com by configuring a web tab of type url as follows:
 
 
In my developer org, when I click my web tab, I get the following error:
INVALID_SESSION_ID:Invalid Session ID found in SessionHeader: Illegal Session
 
However, when my co-worker tested the same link in his developer org, it works!
 
Any reason why it would behave inconsistently? thanks!
 
KS
Hello,
 
Our app is supposed to use Enterprise API and has been coded accordingly. In development and test, I would login using the Enterprise URL and use the subsequent Session Id and server URL returned to make subsequent calls. No problem there.
 
In real worlkd scenario, our app will be working as a tab in Salesforce and people will NOT be login in AGAIN to come to our functionality. We will directly recieve their server URL and session Id. We will than invoke the getUserInfo to retrieve information and identify as to who the user is, etc, etc and proceed.
 
My only question is how do I ensure that I am hitting a URL which is an Enterprise URL ? In my test , since I was manually login in to Enterprise URL , I assume that the serverURL returned by Salesforce will be an enterpriseURL. But in the real world scenario, when the user comes in, he directly passes a Server URL and Session ID, how do I know that the server URL is an Enterprise URL ?
 
Any insights will be appreciated.
 
Thanks,
Milan
  • July 17, 2007
  • Like
  • 0
I'm trying to set the sessionId without using the SessionHeader object. This is the error that I'm getting:

Code:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
 at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:56)
 at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:111)
 at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:460)
 at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:333)
 at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
 at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
 at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
 at $Proxy22.query(Unknown Source)
 at salesforce.JbossWSConnection.querySample(JbossWSConnection.java:130)
 at salesforce.JbossWSConnection.main(JbossWSConnection.java:74)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

 
Does anyone know what the Parameter Name is used to include the sesssionID?  Is it SessionID, sessionID, SessionHeader?
Hi there

I have just downloaded a new Partner WSDL (The first one for a while) and am having problems with the build. When I build the WSDL (using wsdl4java) and try to run a simple unit test that creates a new Account object I am presented with the following exception.

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
 faultActor:
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:732)
    at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:414)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:799)
    at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
    at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
    at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.client.Call.invoke(Call.java:2757)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.enterprise.SoapBindingStub.create(SoapBindingStub.java:1633)
    at com.pctfiler.salesforce.SalesForceQuery.create(SalesForceQuery.java:165)
    at com.pctfiler.salesforce.test.AbstractSalesForceTestCase.createAccount(AbstractSalesForceTestCase.java:88)
    at com.pctfiler.salesforce.TestAbstractSalesForceTestCase.testSimple(TestAbstractSalesForceTestCase.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

    {http://xml.apache.org/axis/}hostname:CHRIS

java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.client.Call.invoke(Call.java:2760)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.enterprise.SoapBindingStub.create(SoapBindingStub.java:1633)
    at com.pctfiler.salesforce.SalesForceQuery.create(SalesForceQuery.java:165)
    at com.pctfiler.salesforce.test.AbstractSalesForceTestCase.createAccount(AbstractSalesForceTestCase.java:88)
    at com.pctfiler.salesforce.TestAbstractSalesForceTestCase.testSimple(TestAbstractSalesForceTestCase.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:732)
    at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:414)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:799)
    at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
    at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
    at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.client.Call.invoke(Call.java:2757)
    ... 23 more

I am not doing anything differently here as I have in previous new builds. I have noticed tho that the endpoint URL is now

https://www.salesforce.com/services/Soap/u/9.0

The last time I ran a WSDL update this was

https://www.salesforce.com/services/Soap/u/8.0

Does anyone have any ideas as to what is going on here?

Thanks

Chris


Hello,
 
In our application, we need to verify if a lead already exists, before we insert (create) a new one. One of the ways we are going to check for existing leads is based on email. i.e If a Lead with a certain email id already exists, it means it need not be inserted (created) again.
 
Now, we may have to insert thousands of leads at a time. Which in turn means verifying all those thousands of leads before we insert them. What is the best possible approach, keeping time in mind, to do this ? Note : Time is critical !
 
One approach that immediately comes to my mind is using a Query in Partner WSDL and passing a batch of say n email Ids at a time. i.e:
 
 qr = stub.query("select email, FirstName, LastName, Id from Contact where email IN ('abc@asd.com', 'werr@dfdf.com' ,'cxvcv@uoa.edu','dfdf.fd@wer.com', 'fd@abc.com' ,...........)");    
   
  1. Would this be a good idea ?
  2. It is never a great idea to fire a 'like' query in existing production database... so do I have a better option ?
  3. Firing a single call for each lead certainly seems a slower option ... isnt it ?

Thus can anyone suggest what is the best practice for such a scenario ?

Thanks,

Milan

  • May 07, 2007
  • Like
  • 0
Hello,
 
We are supposed to Create leads / contacts in Salesforce using Partner WSDL. There may be times when we will be creating more than 5000 leads. So we will be invoking multiple creates (depending upon the batch size).
 
Now, if there is any error in any one of the subsequent calls. How can I rollback the earlier data that was inserted into Salesforce ?
 
I tried searching the docs and also some old postings on the forum and it seems that this feature is not available... :( I hope I am wrong .
 
Thanks,
Milan
  • May 04, 2007
  • Like
  • 0
Hello,
 
I am firing a Query to retrieve some information. Its a simple test program to query contacts within Salesforce.
 
I am setting the Batch Size to 3 (just to understand implementation of batch size in Salesforce and to test that its inline with my understanding)
 
Code:
QueryResult qr = null;
QueryOptions qo = new QueryOptions();
qo.setBatchSize(new Integer(3));
stub.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), 
       "QueryOptions", qo);

 
The request generated is as follows, which is inline with my expectations :
Code:
POST /services/Soap/u/9.0 HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.3
Host: na4-api.salesforce.com:7002
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 929

<—xml version="1.0" encoding="UTF-8"–>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header>
         <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:partner.soap.sforce.com">
            <ns1:sessionId>X.MdpH69QhJuMTs_qEfCdx6CSsJX4ZRKqCwcDq.pR5m2hGyVaHTcsZgDQeW2z0Ihc8MDAV3oO2w_73lxBWwnG.PffGIt.5WPRX.tUakNGDXyQV6RAJI=</ns1:sessionId>
         </ns1:SessionHeader>
         <ns2:QueryOptions soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns2="urn:partner.soap.sforce.com">
            <ns2:batchSize>3</ns2:batchSize>
         </ns2:QueryOptions>
      </soapenv:Header>
      <soapenv:Body>
         <query xmlns="urn:partner.soap.sforce.com">
            <queryString>select email, FirstName, LastName, Id from Contact</queryString>
         </query>
      </soapenv:Body>
   </soapenv:Envelope>

 
The response recieved is as follows:
Code:
Server: 
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 4225
Date: Thu, 03 May 2007 17:53:44 GMT

<—xml version="1.0" encoding="UTF-8"–>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.partner.soap.sforce.com">
      <soapenv:Body>
         <queryResponse>
            <result xsi:type="QueryResult">
               <done>true</done>
               <queryLocator xsi:nil="true"/>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYskAAF</sf:Id>
                  <sf:Email>j.davis@expressl&amp;t.net</sf:Email>
                  <sf:FirstName>Josh</sf:FirstName>
                  <sf:LastName>Davis</sf:LastName>
                  <sf:Id>0036000000OsYskAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYslAAF</sf:Id>
                  <sf:Email>jane_gray@uoa.edu</sf:Email>
                  <sf:FirstName>Jane</sf:FirstName>
                  <sf:LastName>Grey</sf:LastName>
                  <sf:Id>0036000000OsYslAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsnAAF</sf:Id>
                  <sf:Email>agreen@uog.com</sf:Email>
                  <sf:FirstName>Avi</sf:FirstName>
                  <sf:LastName>Green</sf:LastName>
                  <sf:Id>0036000000OsYsnAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsoAAF</sf:Id>
                  <sf:Email>spavlova@uog.com</sf:Email>
                  <sf:FirstName>Stella</sf:FirstName>
                  <sf:LastName>Pavlova</sf:LastName>
                  <sf:Id>0036000000OsYsoAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYspAAF</sf:Id>
                  <sf:Email>lboyle@uog.com</sf:Email>
                  <sf:FirstName>Lauren</sf:FirstName>
                  <sf:LastName>Boyle</sf:LastName>
                  <sf:Id>0036000000OsYspAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsqAAF</sf:Id>
                  <sf:Email>ajames@uog.com</sf:Email>
                  <sf:FirstName>Ashley</sf:FirstName>
                  <sf:LastName>James</sf:LastName>
                  <sf:Id>0036000000OsYsqAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsrAAF</sf:Id>
                  <sf:Email>tripley@uog.com</sf:Email>
                  <sf:FirstName>Tom</sf:FirstName>
                  <sf:LastName>Ripley</sf:LastName>
                  <sf:Id>0036000000OsYsrAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsYAAV</sf:Id>
                  <sf:Email>ldcruz@uog.com</sf:Email>
                  <sf:FirstName>Liz</sf:FirstName>
                  <sf:LastName>D&apos;Cruz</sf:LastName>
                  <sf:Id>0036000000OsYsYAAV</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsZAAV</sf:Id>
                  <sf:Email>efrank@genepoint.com</sf:Email>
                  <sf:FirstName>Edna</sf:FirstName>
                  <sf:LastName>Frank</sf:LastName>
                  <sf:Id>0036000000OsYsZAAV</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYscAAF</sf:Id>
                  <sf:Email>rose@edge.com</sf:Email>
                  <sf:FirstName>Rose</sf:FirstName>
                  <sf:LastName>Gonzalez</sf:LastName>
                  <sf:Id>0036000000OsYscAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsdAAF</sf:Id>
                  <sf:Email>sean@edge.com</sf:Email>
                  <sf:FirstName>Sean</sf:FirstName>
                  <sf:LastName>Forbes</sf:LastName>
                  <sf:Id>0036000000OsYsdAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYseAAF</sf:Id>
                  <sf:Email>jrogers@burlington.com</sf:Email>
                  <sf:FirstName>Jack</sf:FirstName>
                  <sf:LastName>Rogers</sf:LastName>
                  <sf:Id>0036000000OsYseAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYshAAF</sf:Id>
                  <sf:Email>barr_tim@grandhotels.com</sf:Email>
                  <sf:FirstName>Tim</sf:FirstName>
                  <sf:LastName>Barr</sf:LastName>
                  <sf:Id>0036000000OsYshAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsiAAF</sf:Id>
                  <sf:Email>bond_john@grandhotels.com</sf:Email>
                  <sf:FirstName>John</sf:FirstName>
                  <sf:LastName>Bond</sf:LastName>
                  <sf:Id>0036000000OsYsiAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OsYsjAAF</sf:Id>
                  <sf:Email>b.levy@expressl&amp;t.net</sf:Email>
                  <sf:FirstName>Babara</sf:FirstName>
                  <sf:LastName>Levy</sf:LastName>
                  <sf:Id>0036000000OsYsjAAF</sf:Id>
               </records>
               <records xsi:type="sf:sObject">
                  <sf:type>Contact</sf:type>
                  <sf:Id>0036000000OtG86AAF</sf:Id>
                  <sf:Email xsi:nil="true"/>
                  <sf:FirstName>Joe</sf:FirstName>
                  <sf:LastName>Blow</sf:LastName>
                  <sf:Id>0036000000OtG86AAF</sf:Id>
               </records>
               <size>16</size>
            </result>
         </queryResponse>
      </soapenv:Body>
   </soapenv:Envelope>

 
I am not sure why did i recieve ALL 16 contatcs at one go... I was expecting ONLY three contacts to be returned as my batch size is 3. Should it not have been so ? I read somewhere about default to 250 or 500 or so but if I am explicitely setting it to some value (3 in this case), why does it return me everything ?
 
My guess is that something is wrong in my interpretation of batchSize and any insight will be appreciated.
 
Thanks and regards,
Milan
  • May 03, 2007
  • Like
  • 0
Hello Friends,
 
I tried seeing many posts on INVALID_TYPE: Must send a concrete entity type but I am still confused and still havent been able to rectify my code. So I am posting my issue here.
 
I am trying to CREATE a Lead using PARTNER API. The steps followed are as follows:
  1. Login and retrieve the Server URL and Session ID. (This works)
  2. Set the new Session ID and use the retrieveed Server URL from step 1 above to make subsequent call for getUserInfo( ) . (This one works too, which means I am pointing to the right URL and have the session ID set correctly in the header)
  3. Try to create a Lead with the code snippet as follows:

Code:

              SObject[] sObject = new SObject[1];
  MessageElement[] lead = new MessageElement[5];
  lead[0] = new MessageElement(new QName("FirstName"),"Joe");
  lead[1] = new MessageElement(new QName("LastName"),"Doe");
  lead[2] = new MessageElement(new QName("Company"),"John Doe Inc");
  lead[3] = new MessageElement(new QName("Email"),"johndoe@jdoe.com");
  lead[4] = new MessageElement(new QName("Phone"),"4156832669");
  sObject[0] = new SObject();
  sObject[0].setType("Lead");
  sObject[0].set_any(lead);
         SaveResult[] sr = null;
         try {
            sr = stub.create(sObject);
         } catch (Exception ex) {
            System.out.println("An unexpected error has occurred." + ex.getMessage());
           return;
         }


 
I get the following error :

An unexpected error has occurred.INVALID_TYPE: Must send a concrete entity type.

I am using PARTNER API. Any clue what should I do ?Thanks for any insight.

Regards,

Milan

  • May 02, 2007
  • Like
  • 0
What should be the error if I got this error message on the console of my tomcat? "Destination URL not reset. The URL returned from login must be set in the SforceService"? please help me guys...... Thanx guys for your help......
I will really appreciate if someone can tell me how to verify selfservice user in winter'07 release using LoginScopeHeader. An example would be great.

Thanks!
  • December 15, 2006
  • Like
  • 0