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
ElkayElkay 

Web service callout failed: Unable to find header type info forloginResult

I am trying to call a webservice hosted on a different SFDC organization from apex. Sessionheader is set but still I am receiving this error- Web service callout failed: Unable to find header type info forloginResult. Not able to comprehend this error. Help please!!!!!!!!! Webserice stub is as follows:

public class ValidateAccount {
        public String endpoint_x = 'https://cs30.salesforce.com/services/Soap/class/ValidateAccount';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x='IdeaCerti';
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public WebserviceCallValAcc.DebuggingInfo_element DebuggingInfo;
        public WebserviceCallValAcc.DebuggingHeader_element DebuggingHeader;
        public WebserviceCallValAcc.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public WebserviceCallValAcc.SessionHeader_element SessionHeader = new WebserviceCallValAcc.SessionHeader_element();
        public partnerSoapSforceCom.Soap sp = new partnerSoapSforceCom.Soap();
        public partnerSoapSforceCom.LoginResult loginResult = sp.login(username,password);
        public WebserviceCallValAcc.CallOptions_element CallOptions;
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/ValidateAccount';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/ValidateAccount';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/ValidateAccount';
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/ValidateAccount';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/ValidateAccount';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/ValidateAccount', 'WebserviceCallValAcc'};
        public void ValidateAccountWeb(String aName) {
            WebserviceCallValAcc.ValidateAccountWeb_element request_x = new WebserviceCallValAcc.ValidateAccountWeb_element();
            request_x.aName = aName;
            SessionHeader.sessionId=loginResult.sessionId;
            
            system.debug(SessionHeader.sessionId);
            
            WebserviceCallValAcc.ValidateAccountWebResponse_element response_x;
            Map<String, WebserviceCallValAcc.ValidateAccountWebResponse_element> response_map_x = new Map<String, WebserviceCallValAcc.ValidateAccountWebResponse_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/ValidateAccount',
              'ValidateAccountWeb',
              'http://soap.sforce.com/schemas/class/ValidateAccount',
              'ValidateAccountWebResponse',
              'WebserviceCallValAcc.ValidateAccountWebResponse_element'}
            );
            response_x = response_map_x.get('response_x');
           
        }
    }

 
ShashankShashank (Salesforce Developers) 
Please check if the steps in this page will help you resolve your issue: http://developer.force.com/cookbook/recipe/calling-salesforce-web-services-using-apex