• anu08
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 10
    Replies

Hi,

 

We are facing the issue while connecting to web services API  through java program with the following URL.

 

 

Connected to SF with the URL: https://na1-api.salesforce.com/services/Soap/c/18.0/00D30000000eOvr/0DF300000008fAD

 

sometimes, it is connecting fine, and sometimes it is disconnecting. We found some inconsistancy while connecting to salesforce.

 

We are getting axis Fault exception : Connection Timed Out.

 

Can you please Help on this.

 

Thanks.

 

  • May 06, 2010
  • Like
  • 0

As per our client requirement, I have written a trigger on Task. Details are below:
Business Case:
Customer will perform some business functionality at Offline and will create at least 60 and more Tasks at offline and will assign to different Contacts. After Synchronization, system will insert all these Tasks at Online. For every task we need to send a separate mail which will have text + some HTML tags (TextBox, check box, submit button etc.. ) to concern Contacts. But due to Salesforce Limitations, I'm getting the following error:
18:26:59.732|EXCEPTION_THROWN|[68,53]|System.Exception: Too many Email Invocations: 11

We would like to have your immediate attention for this issue, as this is the top most show stopper for Go-Live and the Go-Live date is already delay.

Source code:
trigger TaskMail on Task (after insert,after update){
Set<Id> taskIds=new Set<Id>();
for(Task t:Trigger.New){
taskIds.add(t.Id);
}
TaskFuture.sendMassMails(taskIds);
} // end of trigger

public class TaskFuture{

public static void sendMassMails(Set<Id> taskIds){
Map<Id,Task> taskMap=new Map<Id,Task>([select Id,whoID,Send_Mail_to_Contacts__c,Subject,Account__c,Product__c,Status,Priority,Description from Task where Id IN :taskIds]);
Set<Id> contactIds=new Set<Id>();
for(Id key:taskIds){
contactIds.add(taskMap.get(key).whoID);
}
Map<Id,Contact> contactMap=new Map<Id,Contact>([select Id, Name, Email from Contact where ID IN :contactIds]);
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
//for mass email
//List<Messaging.MassEmailMessage> mails =new List<Messaging.MassEmailMessage>();

//Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
//EmailTemplate e1 = [select Id,Name,Subject,body from EmailTemplate where name like :'TaskTemplate'+'%'];
//DRL-Live
String url ='http://salesforce.drreddys.in:8080/DRLLive/DRLTaskSubmit';
// DRL-Test Server
// String url ='http://salesforce.drreddys.in:8080/DRLTest/DRLTaskSubmit';
//Bodhtree Public IP server
// String url= 'http://220.227.247.122:2010/DRL/DRLTaskSubmit';
for(Id key:taskIds){
Task t=taskMap.get(key);
mail = new Messaging.SingleEmailMessage();
//mail =new Messaging.MassEmailMessage();
System.debug('++++++++Who.ID++++++++++'+t.whoID);
Contact c=contactMap.get(t.whoID);
System.debug('++++++++Name+++++++++'+c.Name);
System.debug('++++++++Email++++++++++'+c.Email);
// ===============For MOM=======================
try{
if(t.WhoID!=null && t.Send_Mail_to_Contacts__c==true){

String[] toaddress = new String[]{c.Email};
// mail.setTargetObjectIds(new Id[] {c.Id});
mail.setToAddresses(toaddress);
mail.setsubject(t.Subject);
//User ur = [select Name from User where ID=:t.OwnerId];

// mail.setTemplateId(e1.Id);
//mail.setWhatIds(new Id[]{t.Id});
mail.setHtmlBody('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>' +
'<title>DRL Task Update</title></head>'+
'<body><form action="'+url+'" method="post" target="_blank"><p>Hi <B>'+c.Name+'</B><br/>A New Task has been created for <br/> Account : '+t.Account__c+'<br/>Product :'+t.Product__c+'. Details of the Task are:<br/><br/> <B>Subject :</B>'+' '+t.Subject+
'<br/><table border="1"><tr><td>Status : </td><td>'+t.Status+'</td></tr><tr><td>Contact : </td><td>'+c.Name+'</td></tr><tr><td>Priority : </td><td>'+t.Priority+'</td></tr><tr><td>Comments : </td><td>'+t.Description+'</td></tr></table>'+

'<br/><b></p>To Update The Values ,Please Do it in the Following Fields : </b><table border="1">'+
'<input type="hidden" name="taskId" value="' + t.Id + '"/>'+
'<br/>Status :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <select name="Status"><option value="Not Started">Not Started</option><option value="In progress">In Progress</option><option value="Completed">Completed</option><option value="Delayed">Delayed</option> </select>'+
'<br />Description : <input type="text" name="Description" /><br />' +
'<br/><input type="submit" value="Update" /> </table>'+
'<p><br/>Thanks<br/> Salesforce Support. </p></form></body></html> ');

mails.add(mail);
}
}catch(Exception e){
System.debug(' Exception in Email Try Block .....\t'+e);
}
} // end of for
List<Messaging.Email> allMails = new List<Messaging.Email>();
for( Integer j = 0; j < mails.size(); j++ ){
allMails.add(mails.get(j));
}
Messaging.SendEmailResult[] results = Messaging.sendEmail( allMails );
} // end of method
} // end of class

  • April 28, 2010
  • Like
  • 0

Hi All,

 

How to change Application(App) for Profile while cilick on the button in Visual Force Pages then it goes to another App ,and I want2 customize tabs also dynamically for that app from vf pages.

 

 

 

Thanks

vasu

  • February 26, 2010
  • Like
  • 0

Hi

 

I have a Custom lookup field "Assigned to User" which assignes to user's list. When I select a user in that field, automatically an email will sent to that corresponding user. How can we get it?

  • February 12, 2010
  • Like
  • 0

Hi All,

When I will sent an email to non sales force users (like gmail or yahoo or any other email user) , after receive an  email from sales force users with link , when they click on the link ,the changes are automatically reflected on sales force of any Object of Field , is it possile or  not , I am new SF ,Can any one resp plz 

 

Thanks

vs

  • February 12, 2010
  • Like
  • 0
Hi I have a problem. I have a sample order form page. I send the fields information of that page through mail merge template to another non salesforce.com user. If that user update that fields how can we get the updated fields in salesforce sample order form page. Could any one give the solution for this problem? Thanks
  • February 10, 2010
  • Like
  • 0

Hi

 

I have a problem.

I have a sample order form page. I send the fields information of that page through mail merge template to another non salesforce.com user. If that user update that fields how can we get the updated fields in salesforce  sample order form page.

 

 

Could any one give the solution for this problem?

 

Thanks

  • February 10, 2010
  • Like
  • 0

Hi

 

I want 2 change View LayOut page ,when I select drop-down sample from List ,it will apppear with a button in view page

 not selected Sample it will hide button in view page means different layout page

 

Thanks

Vasu

  • January 27, 2010
  • Like
  • 0

I have Custom Object called SampleOrderForm which has 2 lookup Fields 1.Opportunity 2. Account.

When I Click new SampleorderForm Object in one of Opportunity View page , auto map look up fields values into SampleOrderForm Object 

suppose Account is Airtel and Opportunity is 249 ,auto comlete values into SampleOrderForm Object When I Create new SampleOrderForm in Opportunity  249 .

 

Thanks

vasu

  • January 27, 2010
  • Like
  • 0

 

This is my Test Method:

 

@isTest
private class ContractMasterControllerTestClass2{
    static testMethod void contractMastermethod(){
 
      ApexPages.currentPage().getParameters().put('id', '800O00000000Kp4');  
        ContractMasterController  ct = new ContractMasterController();
       
        List<ContractMaster__c> c = ct.getContractMasterDet();
        List<ContractMaster__c> t = ct.getContractMasterreports();               
       
        ContractMaster__c conmaster = [SELECT Specification_on_dry_basis__c,Fines__c,Lumps__c,UltraFines__c from
                                        ContractMaster__c where Name=:'000153'];

       /*List<ContractMaster__c> cupdate=new List<ContractMaster__c>();
       List<ContractMaster__c> cinsert=new List<ContractMaster__c>();

update cupdate;
insert cinsert;*/
        // Retrieve account
        ct.coninsert= [SELECT Status, Seller__c,
        Buyer__c,
        Account.Name,
        ContractNo__c,
        Commodity__c,
        FinesQtyperyear__c,
        LumpsQtyperyear__c,
        UltraFinesQtyPerYear__c,
        AdditionalQtyifany__c,
        EndDate,
        ContractTerm,
        StartDate,Fines__c,Lumps__c,UltraFines__c
        FROM Contract WHERE Id =:'800O00000000Kp4IAE'];
       
        Date dat = Date.today();
       
        Contract newcon = new Contract();
        newcon.AccountID='001O0000001nmuG';
        newcon.Name='TCS';
        newcon.Status='Draft';
        newcon.StartDate=dat;
        newcon.ContractTerm=15;
        insert newcon;  
          // ct.setconinsert(newcon);
  
PageReference pref1 = ct.MyUpdate(); 
        update newcon;
        delete  newcon;
 
    PageReference pref2 = ct.MyEdit();   
    PageReference pref3 = ct.Cancel();      
    PageReference pref4=ct.MYSave();
       System.debug(pref4);
      
    }

 

 

 

 

I got the Following Error:

 

System.DmlException: Insert failed. First exception on row 0 with id 800O00000000Kp4IAE; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

 

 

 

Could you Please Provide me the solution for this.
   
}
 
}

  • January 15, 2010
  • Like
  • 0

Hi All

 

I don't how to integrate paypal with Sales Force CRM , 

 

Paypal has provided 1 wsdl file and 2 xsd's 

 

 


These file are related webservice here PayPalSrv.wsdl has import tags and mutliple portbings and multiple port types ,So I am unable to generate Apex Stub Classes from above file , it throws error message multiple bindings and port types and etc .

 

Can u any help me ............

 

Thanks

VS.....

 

  • November 06, 2009
  • Like
  • 0

Hi All,

 

I am Also suffer from same Situation (Exchange Data from Sales force Organization 1 to Sales force Organization 2 )

I wrote Apex class for SF Org1 has  TestWebService class.

I want  get data from SF Org1 to SF Org2 by using webservice methods in Apex class in SF Org1  and that class generates WSDL file and upload WSDL file into SF Org2 and it generate Stub class from WSDL file.

 

Apex class for SF Org1 has one web method below

 

global class TestWebService{   
    webService static String testWebMethod(String testname ){
        return 'Hello '+testname;
    }
}

 

And Generated WSDL file from above class called TestWebService

 

<?xml version="1.0" encoding="UTF-8"?>
<!--
 Web Services API : TestWebService
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/TestWebService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/TestWebService">
 <types>
  <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/TestWebService">
   <xsd:element name="DebuggingInfo">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="debugLog" type="xsd:string"/>
     </xsd:sequence>

 

 

I deployed wsdl  file into Another SF Org2  it generates Stub class from above wsdl file called TestWebServiceStub

 

 

    

public classs public TestWebServiceStub {


--------------------------

-----------------------
public class TestWebService {
        public String endpoint_x = 'https://ap1-api.salesforce.com/services/Soap/class/TestWebService';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public TestWebServiceStub.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public TestWebServiceStub.DebuggingInfo_element DebuggingInfo;
        public TestWebServiceStub.CallOptions_element CallOptions;
        public TestWebServiceStub.DebuggingHeader_element DebuggingHeader;
        public TestWebServiceStub.SessionHeader_element SessionHeader;
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/TestWebService';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/TestWebService';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/TestWebService';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/TestWebService';
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/TestWebService';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/TestWebService', 'TestWebServiceStub'};
        public String testWebMethod(String testname) {
            TestWebServiceStub.testWebMethod_element request_x = new TestWebServiceStub.testWebMethod_element();
            TestWebServiceStub.testWebMethodResponse_element response_x;
            request_x.testname = testname;
            Map<String, TestWebServiceStub.testWebMethodResponse_element> response_map_x = new Map<String, TestWebServiceStub.testWebMethodResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/TestWebService',
              'testWebMethod',
              'http://soap.sforce.com/schemas/class/TestWebService',
              'testWebMethodResponse',
              'TestWebServiceStub.testWebMethodResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }

 

-------------------

--------------------

}

 

 

 And I wrote controller in SF Org2 ,  Access  SF Org1 from TestWebService class  in that method testWebMethod(String testname)

 

Controller in SF Org2

 

 TestWebServiceStub.TestWebService testStub = new TestWebServiceStub.TestWebService();

testStub.inputHttpHeaders_x = new Map<String, String>();

 

testStub.inputHttpHeaders_x.put('Authorization','Basic YXJ1bmFAYm9kaHRyZWUuY29tOmJvZGh0cmVlMTIzVW9RSFJPVFBaWjRWcko3NUZrWFg0TUJEeA==');  

 

Here I Provided Encode 63 bit code is ---        username:passwordsecurtytoken        

 

 

String nameresp = testStub.testWebMethod('Hi Hello ');

 

 

 

 

I got I Exception Called  InValid SessionHeader and System.callout Exception

 

Can u any give a solutions for this

 

Thanks

Vasu

 

 

 

  • November 04, 2009
  • Like
  • 0

Hi All,

 

Can u any one help  I am new to Sales force ,How Integrate sales force with paypal  ,

How can procede , what is the best way follow 

 

I have downloaded 1 wsdl and 2 xsd files from paypal site and while uploading into sales force it doesn't suporting 

 

and also i copied xsd schemas in to wsdl but it show errors  can u please me how to write 2 schemas in to one wsd

 

 wsdl file :

 

 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    ns:version="60.0"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns="urn:ebay:api:PayPalAPI"
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
    xmlns:cc="urn:ebay:apis:CoreComponentTypes"
    xmlns:ed="urn:ebay:apis:EnhancedDataTypes"
    targetNamespace="urn:ebay:api:PayPalAPI">
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:api:PayPalAPI" elementFormDefault="qualified" attributeFormDefault="unqualified">
            <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
            <import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
            <import namespace="urn:ebay:apis:EnhancedDataTypes" schemaLocation="EnhancedDataTypes.xsd"/>

 

 

--------

---------

 

I found the difficulty while parsing the  wsdl file (Bcz it has some import xsd's and i can't paste the xsd

in the same wsdl file  it supports sales force wsdl file )  in the force.com ,

 

Could please give  solution 

 

 

Thanks

vasu

 

 

 

 

thanks

vasu

Message Edited by anu08 on 10-30-2009 01:02 AM
  • October 29, 2009
  • Like
  • 0

Hi Every One,

 

I have problem with how jsp pages integrate with Visual force pages and I want Calendar display on Visual force page 

like Home tab page contain  Claendar ,

can any one solve this prob,

 

thanks

 

vasu

  • October 21, 2009
  • Like
  • 0

Hi

 I design a home page and i override the new button of a custom object with that page. I enter the values in the corresponding fields., when i click save button i need to display the values as like as custom fields. that is i need to display the values in corresponding home page. can you help in the coding part of that?

  • October 20, 2009
  • Like
  • 0
How to Display Calendar Object on Custom home page  or  visual force pages
  • October 20, 2009
  • Like
  • 0
Hi I have a problem. I have a sample order form page. I send the fields information of that page through mail merge template to another non salesforce.com user. If that user update that fields how can we get the updated fields in salesforce sample order form page. Could any one give the solution for this problem? Thanks
  • February 10, 2010
  • Like
  • 0

Hi All

 

I don't how to integrate paypal with Sales Force CRM , 

 

Paypal has provided 1 wsdl file and 2 xsd's 

 

 


These file are related webservice here PayPalSrv.wsdl has import tags and mutliple portbings and multiple port types ,So I am unable to generate Apex Stub Classes from above file , it throws error message multiple bindings and port types and etc .

 

Can u any help me ............

 

Thanks

VS.....

 

  • November 06, 2009
  • Like
  • 0

Hi All,

 

Can u any one help  I am new to Sales force ,How Integrate sales force with paypal  ,

How can procede , what is the best way follow 

 

I have downloaded 1 wsdl and 2 xsd files from paypal site and while uploading into sales force it doesn't suporting 

 

and also i copied xsd schemas in to wsdl but it show errors  can u please me how to write 2 schemas in to one wsd

 

 wsdl file :

 

 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    ns:version="60.0"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns="urn:ebay:api:PayPalAPI"
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
    xmlns:cc="urn:ebay:apis:CoreComponentTypes"
    xmlns:ed="urn:ebay:apis:EnhancedDataTypes"
    targetNamespace="urn:ebay:api:PayPalAPI">
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:api:PayPalAPI" elementFormDefault="qualified" attributeFormDefault="unqualified">
            <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
            <import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
            <import namespace="urn:ebay:apis:EnhancedDataTypes" schemaLocation="EnhancedDataTypes.xsd"/>

 

 

--------

---------

 

I found the difficulty while parsing the  wsdl file (Bcz it has some import xsd's and i can't paste the xsd

in the same wsdl file  it supports sales force wsdl file )  in the force.com ,

 

Could please give  solution 

 

 

Thanks

vasu

 

 

 

 

thanks

vasu

Message Edited by anu08 on 10-30-2009 01:02 AM
  • October 29, 2009
  • Like
  • 0
How to Display Calendar Object on Custom home page  or  visual force pages
  • October 20, 2009
  • Like
  • 0

Person.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://www.person.org" xmlns="http://www.person.org"

elementFormDefault="qualified"> <xsd:complexType name="PersonType"> <xsd:sequence> <xsd:element name="Name" type="xsd:string"/> <xsd:element name="SSN" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Product.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.product.org" xmlns="http://www.product.org" elementFormDefault="qualified"> <xsd:complexType name="ProductType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Company.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.company.org" xmlns="http://www.company.org" xmlns:per="http://www.person.org" xmlns:pro="http://www.product.org" elementFormDefault="qualified"> <xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/> <xsd:element name="Company"> <xsd:complexType> <xsd:sequence> <xsd:element name="Person" type="per:PersonType" maxOccurs="unbounded"/>

<xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

 

 

In Company.xsd it imports an external schema, which is not supported in APEX.
Please let me know how to replace the following two lines:

 

<xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/>

 

Thanks in advance. 

 Sankar
  • September 25, 2009
  • Like
  • 0

I am using axis2 to generate the java classes from the partner.wsdl

While calling getUserInfo() method in the SforceStub in the partner.wsdl I am getting an exception as specified below:

 

 org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.axiom.om.OMException: java.lang.IllegalStateException

org.apache.axiom.om.OMException: java.lang.IllegalStateException
    org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
    org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:127)
    org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:328)
    com.sforce.soap.partner.SforceServiceStub.toOM(SforceServiceStub.java:10726)
    com.sforce.soap.partner.SforceServiceStub.toEnvelope(SforceServiceStub.java:11176)
    com.sforce.soap.partner.SforceServiceStub.getUserInfo(SforceServiceStub.java:9555)

java.lang.IllegalStateException
    org.apache.xmlbeans.impl.store.Jsr173$XMLStreamReaderForString.next(Jsr173.java:1110)
    org.apache.xmlbeans.impl.store.Jsr173$SyncedJsr173.next(Jsr173.java:1138)
    org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
    org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125)
    org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:127)
    org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:328)
    com.sforce.soap.partner.SforceServiceStub.toOM(SforceServiceStub.java:10726)
    com.sforce.soap.partner.SforceServiceStub.toEnvelope(SforceServiceStub.java:11176)
    com.sforce.soap.partner.SforceServiceStub.getUserInfo(SforceServiceStub.java:9555)

 

Do anyone have why this error is coming???

 

 

 

Message Edited by AnnParampathoor on 06-23-2009 10:41 PM

Note : Following is a small development being carried out to demystify salesforce apex webservice and callout features, please correct me if you find my understanding to be incorrect.

 

I am trying to integrate two Salesforce Orgs using Apex. Apex supports both callouts and webservices, then why not leverage both to achieve a 360 connectivity between two Salesforce instances.

 

Org1 : Create a Apex Web Service, Generate its WSDL

global class AccountPlan {

webservice String area;
webservice String region;

//Define an object in apex that is exposed in apex web service
global class Plan {
webservice String name;
webservice Integer planNumber;
webservice Date planningPeriod;
webservice Id planId;
}

webservice static Plan createAccountPlan(Plan vPlan) {

//A plan maps to the Account object in salesforce.com.
//So need to map the Plan class object to Account standard object
Account acct = new Account();
acct.Name = vPlan.name;
acct.AccountNumber = String.valueOf(vPlan.planNumber);
insert acct;

vPlan.planId=acct.Id;
return vPlan;
}

}

 

Org2:  Consume above generated WSDL to generate following Apex Class viz.,AccountPlanClasses

public class AccountPlanClasses {
public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};
}
public class AllowFieldTruncationHeader_element {
............................
............................

 

Now lets try to connect to Org1 from Org2

AccountPlanClasses.Plan plan = new AccountPlanClasses.Plan();
plan.name = 'Chirag';
plan.planNumber = 111;
AccountPlanClasses.AccountPlan a = new AccountPlanClasses.AccountPlan();
a.createAccountPlan(plan);

 

Execution of above code runs into following error

WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor= 

 

I to feel that somewhere I am missing User Credentials to be supplied, but I dont know exactly where. Please guide me to complete this 360 connectivity between two orgs using Apex.

Message Edited by Chirag Mehta on 05-05-2009 06:13 AM
Message Edited by Chirag Mehta on 05-12-2009 07:52 PM

I downloaded metadata from my dev instnce and developed code on that(java code to create objects), now i am trying to use another login, but i ma not able to use my metadata for that login..

 

 

any suggestion to overcome this, its very urgent...

 

i am getting the following error

 

 

 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 511800D80000000LvBm!AQQAQB3QNt1eH_4MOjT9PEAvJzrqfBdQHHNeD1XCpTmp3NauNvj95SxX_COjVj570Fek0b4VbjCSRNTdTZibUpYDw0GnqPNE

Message Edited by visualforce_dev on 02-09-2009 10:47 PM
Hello Everyone,

I am very new to Salesforce.com, I need to read and write a CSV file using Apex code.

Functionality wants to implement : Read some records using query and write into a excel file and
read a CSV file and insert records into database.
this should be using apex code.

Please help me :)

Thanks