web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Consume Web Serivce - System.ServiceModel.FaultException: Client request message schema validation failure

(0) ShareShare
ReportReport
Posted on by 25

Dears Experts, I am using below code to consume the service However when i called the method  "Client request message schema validation failure" error came. I am not so sure what i am missing here.

I am using hardcoded values to simplify the things.

1) The same is working fine if i directly call from the Console or windows application in C#.Net

2) I tried to send sample XML via SOAPUI and its working fine there as well.

3) I have add the C# project in the AOT

4) Deploy property Client and Server because will be running in batch as well

SEDAEltizam.ServiceReference1.EltezamDataServiceClient                  service;

   SEDAEltizam.ServiceReference1.CommonErrorStructure                      ErrorSVC;

   SEDAEltizam.ServiceReference1.SubmitEmployeeInfoRequestStructure        empstructure;

   SEDAEltizam.ServiceReference1.submitEmployeeInfoResponseStructure       res;

   SEDAEltizam.ServiceReference1.EmployeeInfoStructure                     empInfo;

 

 

   SEDAEltizam.ServiceReference1.JobInfoStructure                          jobInfo;

   SEDAEltizam.ServiceReference1.PersonalInfoStructure                     personalInfo;

   SEDAEltizam.ServiceReference1.PersonNameStructure                       personNameStructure;

   SEDAEltizam.ServiceReference1.PersonIdentifierSummaryStructure          personIdentifier;  

   System.ServiceModel.Description.ServiceEndpoint endPoint;

   System.Exception ex;

   System.Type type;

     try

   {       

       type = CLRInterop::getType('....ServiceReference1.DataServiceClient');

       service = AifUtil::createServiceClient(type);    

       endPoint = service.get_Endpoint();  

       endPoint.set_Address(new System.ServiceModel.EndpointAddress(".../Employment/Testdata/2.0/TestDataService.svc?wsdl"));

   

       empstructure = new SEDAEltizam.ServiceReference1.SubmitEmployeeInfoRequestStructure();

         empInfo = new SEDAEltizam.ServiceReference1.EmployeeInfoStructure();  

       empInfo.set_EmployeeID("123456");//hcmWorker.PersonnelNumber);

       personalInfo = new SEDAEltizam.ServiceReference1.PersonalInfoStructure();

       personalInfo.set_EmailAddress("test@outlook.com");

       

       

       personIdentifier = new SEDAEltizam.ServiceReference1.PersonIdentifierSummaryStructure();

       personIdentifier.set_ItemElementName(SEDAEltizam.ServiceReference1.ItemChoiceType::NationalID);

       personIdentifier.set_Item("1028308656");  

       personalInfo.set_PersonIdentifier(personIdentifier);//set  

       personNameStructure = new SEDAEltizam.ServiceReference1.PersonNameStructure();  

       personNameStructure.set_FirstName("FirstA");

       personNameStructure.set_SecondName("SecondB");

       personNameStructure.set_ThirdName("ThirdC");

       personNameStructure.set_LastName("LastL");

 

       personalInfo.set_PersonNameAr(personNameStructure); //set   

 

       personalInfo.set_BirthDate("26-10-1440");

 

           personalInfo.set_Gender(SEDAEltizam.ServiceReference1.GenderType::F);

       personalInfo.set_Religion(SEDAEltizam.ServiceReference1.ReligionType::Muslim);

       personalInfo.set_MaritalStatus(SEDAEltizam.ServiceReference1.MaritalStatusType::Married);

       personalInfo.set_Mobile("0537402936");//electronicAddress.Locator);

       personalInfo.set_NationalityCode("SAU");//privateDetails.CitizenshipCountryRegion);

       personalInfo.set_Healthstatus(SEDAEltizam.ServiceReference1.HealthstatusType::Healthy);

       personalInfo.set_BloodType(SEDAEltizam.ServiceReference1.BloodTypeType::OPositive);

       personalInfo.set_BloodTypeSpecified(false);

       empInfo.set_EmployeeStatusCode("EMPLS-01");

 

       jobInfo = new SEDAEltizam.ServiceReference1.JobInfoStructure();

       jobInfo.set_ActualJobNameCode("000001001");

       jobinfo.set_ActualJobNameDescription("Test");

       jobInfo.set_BasicSalary(1000);       

       jobInfo.set_EmploymentTypeCode("EMPT-01");

       jobInfo.set_FirstGradeDate("26-10-1440");

       jobInfo.set_JobClassCode("99999");

       jobInfo.set_JobClassDescription("Test");

 

      //"Required data is mismatch with the current data");

       jobInfo.set_JobNameCode("000001001");

       jobInfo.set_JobNameDescription("TEST");

       //job

       jobInfo.set_JobNumber("12");

       jobInfo.set_JobOrganizationID("55");

       jobInfo.set_JobOrganizationName("Test");

       jobInfo.set_RankCode("R-0101");

       jobInfo.set_StepDate("26-10-1440");

       jobInfo.set_StepID(12);//str2int(HcmPosition::findByPosition(hcmWorker.primaryPositionId()).CompensationLevelId));

 

 

       empInfo.set_JobInfo(jobInfo); //Set

 

 

 

       empinfo.set_ActualOrganizationID("1234");

       empInfo.set_ActualOrganizationName("Test");

 

       empinfo.set_LocationCode("105050?");

       empInfo.set_TransactionCode("TXN-01");

       empinfo.set_MinistryHireDate("26-10-1440");

       empInfo.set_GovernmentHireDate("26-10-1440");

       empInfo.set_IsActive(SEDAEltizam.ServiceReference1.YesNoType::Yes);

 

       empInfo.set_PersonalInfo(personalInfo); //Set

 

       empstructure.set_EmployeeInfo(empInfo);//Set

       empstructure.set_LastUpdateDate("01-01-1440");

      

 

      

       res = service.SubmitEmployeeInfo(empstructure);

 

      //nfo(strFmt('%1', service.SubmitEmployeeInfo(empstructure)));

   }

   catch(Exception::CLRError)

   {        //ex = CLRInterop::getLastException();

       //info(CLRInterop::getAnyTypeForObject(ex.ToString()));

   }

   

I have the same question (0)
  • Verified answer
    Luke Sha Profile Picture
    on at

    if same code running well Console or windows application in C#.Net,  you may check the account to run your service client

  • Mansoor392 Profile Picture
    5 on at

    You find the solution ?  I am facing same problem with same API .  "Eltizam" .

  • MSobhi Profile Picture
    5 on at

    You Can Check  Fields Data Types and also date format 

    For me in the same web service (Eltizam) , it needs Hijri Date and I provided Gregorian date and it works Fine

    And Also Check Your mandatory Fields

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans