function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vijayabakarareddy yarrabothulavijayabakarareddy yarrabothula 

i am creating Account from using partner wsdl , And it is generating session id and login success but data is not inserting into Account Obj


//i am creating Account from using partner wsdl , And it is generating  session id and  login success  but data is not inserting into Account Obj
//upto line no 26 is  executing  after that it is not executing
//

global class CustomerServiceController{

    public PageReference doSave() {
    
     //connection
     partnerSoapSforceCom.soap mypartnerSoap= new  partnerSoapSforceCom.soap();
    partnerSoapSforceCom.LoginResult partnerloginResult =
     mypartnerSoap.Login('**********************@gmail.com','*******************fi4ZlW9JYldRbmNG2EfD9kd1');
     System.debug('baskar-------------------------------->'+partnerloginResult);
     System.debug('your sessio id------------------------>'+partnerloginResult.sessionId);
     
     
          
     //parameter passing
     
     String sessionId = partnerLoginResult.sessionId;
soapSforceComSchemasClassAccountser.SessionHeader_element 
 webserviceSessionHeader =
  new  soapSforceComSchemasClassAccountser.SessionHeader_element();
  webserviceSessionHeader.sessionId =sessionId;
   System.debug('this is line no 20-------------->');
  soapSforceComSchemasClassAccountser.AccountService objA1 =
   new  soapSforceComSchemasClassAccountser.AccountService();
    System.debug('this is line no 23-------------->');
   objA1.SessionHeader = webserviceSessionHeader;
   
    System.debug('this is line no 26-------------->');
   String status = objA1.createCustomer(objA.Name,objA.phone,objA.Site);
    if(status=='success'){
     System.debug('this is line no 29-------------->');
      Insert objA;
       System.debug('this is line no 31-------------->');
      }
      
      if(objA.Id!=NULL){
       System.debug('customer created successfully-------------->');
        statusmsg ='customer created successfully';
        }
    
        return null;
    }

  public Account objA{get;set;}
  public String statusmsg {get;set;}
  public CustomerServiceController(){
   objA= new Account();
   statusmsg='';
   
 }
 }



//apex code

<apex:page controller="CustomerServiceController" tabStyle="Account"> <apex:form > <apex:outputText value="{!statusmsg}"></apex:outputText> <apex:pageBlock title="new customer" > <apex:pageBlockSection columns="1" title="personal info"> <apex:inputField value="{!objA.Name}" > </apex:inputField> <apex:inputField value="{!objA.Phone}"> </apex:inputField> </apex:pageBlockSection> <apex:pageBlockSection columns="1" title="l Address info2"> <apex:inputField value="{!objA.Site}"></apex:inputField> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!doSave}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>

//AccountService class in Source org

global class AccountService{
webService static String createCustomer(String Name,String phone, String Site)
{
Account objA= new Account();
objA.Name= Name;
objA.phone=phone;
objA.Site=site;

 if(objA.Id!= NULL)
 {
 return 'success';
  
  }
   else{
   return 'failure'
   ;}

}
User-added image