• Aldrin Rasdas 26
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi,

I'm trying to consume/call a webservice from SAP/APIGEE. I have already the target endpoint to remotes sites settings, etc.

Given the WSDL file from SAP/APIGEE team, I have generated the stub class using "Generate from WSDL"

But when trying to call the service, i am getting this error:
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found 'urn:sap-com:document:sap:soap:functions:mc-style:GetEmployeeResponse'

Here's the WebServiceCallout.invoke lines (if it matters: i can see that the expected response is correctly specified, and yet it looks for something else)
WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'GetEmployee',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'GetEmployeeResponse',
              'HLG_sapComDocumentSapSoapFunctionsMcS.GetEmployeeResponse_element'}
            );

I tried to simulate the call using SOAPui, and the result/response is something like this:
<ns1:GetEmployeeResponse xmlns:ns1="urn:sap-com:document:sap:soap:functions:mc-style">
   <Empinfo>
      <EmployeePersonalNumber>10033928</EmployeePersonalNumber>
      <UserName>abhyrtj</UserName>
      <AssignmentType>AB</AssignmentType>
      <AssignmentTypeDescription>test description</AssignmentTypeDescription>
      <CompanyCode>CC</CompanyCode>
      <CmapnyName>Test Company</CmapnyName>
      <Ctps>test</Ctps>
      <CtpsSerie>test</CtpsSerie>
      <CtpsUF>test</CtpsUF>
      <Imss>test</Imss>
      <Nationality>US</Nationality>
      <CountryName>USA</CountryName>
      <AnnualSalary>435345.02</AnnualSalary>
      <AnnualSalaryCurrency>$</AnnualSalaryCurrency>
      <AnnualCurrencyDescription>test description</AnnualCurrencyDescription>
      <WorkContract>AB</WorkContract>
      <WorkContractDescription>test description</WorkContractDescription>
      <EndDate>2017-12-25</EndDate>
      <EmploymentPercentage>98.25</EmploymentPercentage>
      <HoursPerWeek>9.00</HoursPerWeek>
   </Empinfo>
</ns1:GetEmployeeResponse>

THANK YOU SO MUCH IN ADVANCE!