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
ashok  45ashok 45 

Getting Error Calling ServAuthHeader

Hi All,
 I am getting error Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=  while passing service auth header in method.
 
 Can anyone help me to solve this issue.

 This is the GeneratedWsdlClass. Here I am facing the problewm with ServiceAuthHeader
 
 Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=
 
Public class GeneratedWsdlClass
{
 public class ServiceAuthHeader 
 {
        public String Password;
        public String Username;
        private String[] Password_type_info = new String[]{'Password','urn:Contracts:MessageContacts',null,'0','1','true'};
        private String[] Username_type_info = new String[]{'Username','urn:Contracts:MessageContacts',null,'0','1','true'};
        private String[] apex_schema_type_info = new String[]{'urn:Contracts:MessageContacts','true','false'};
        private String[] field_order_type_info = new String[]{'Password','Username'};
 }
}

 I have written this snippet in my apex class and excuted am getting error as Web service callout failed: WebService returned a SOAP Fault: No security header detected (from client) faultcode=env:Client faultactor=

        
        GeneratedWsdlClass.ServiceAuthHeader sah=new GeneratedWsdlClass.ServiceAuthHeader();
        sah.username='gsgf98hg';
        sah.password='htg854hgf';