You need to sign in to do that
Don't have an account?
cannot get WebServiceCallout.invoke working!
I have created a very simple service in peoplesoft. All it does is take two numbers and returns the sum. I know this service works through manually sending soap requests to the service.
I am able to generate apex classes via the wsdl2apex generator.
However, when I use those classes to do the callout, I get the following error:
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_RESULT_SIMPLE.V1=result
Class.BOSSMathService.MathServiceSimple_Port.Add: line 20, column 13
Class.PricingCalculator.test: line 78, column 48
External entry point
My generated class:
//Generated by wsdl2apex public class BOSSMathService { public class MathServiceSimple_Port { public String endpoint_x = 'http://mypsoftwebsite.com/PSIGW/PeopleSoftServiceListeningConnector'; public Map<String,String> inputHttpHeaders_x; public Map<String,String> outputHttpHeaders_x; public String clientCertName_x; public String clientCert_x; public String clientCertPasswd_x; public Integer timeout_x; private String[] ns_map_type_info = new String[]{'http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_ADD_SIMPLE.V1', 'BOSSAddInput', 'http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_RESULT_SIMPLE.V1', 'BOSSResult', 'http://xmlns.oracle.com/Enterprise/ERP/services/MathServiceSimple.1', 'BOSSMathService'}; public Integer Add(Integer num1,Integer num2) { BOSSAddInput.Add_element request_x = new BOSSAddInput.Add_element(); BOSSResult.ResultGroup_element response_x; request_x.num1 = num1; request_x.num2 = num2; Map<String, BOSSResult.ResultGroup_element> response_map_x = new Map<String, BOSSResult.ResultGroup_element>(); response_map_x.put('response_x', response_x); WebServiceCallout.invoke( this, request_x, response_map_x, new String[]{endpoint_x, 'Add.V1', 'http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_ADD_SIMPLE.V1', 'Add', 'http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_RESULT_SIMPLE.V1', 'ResultGroup', 'BOSSResult.ResultGroup_element'} ); response_x = response_map_x.get('response_x'); return response_x.result; } } }
Here is the code that invokes the callout:
BOSSMathService.MathServiceSimple_Port msp = new BOSSMathService.MathServiceSimple_Port(); System.debug('result = ' + String.valueOf(msp.ADD(4, 10)));
I know the request is being processed and that something is being returned from PeopleSoft via the Psoft logs. Here is the raw xml coming back from the service:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ResultGroup xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/TI_RESULT_SIMPLE.V1"> <result>10</result> </ResultGroup> </soapenv:Body> </soapenv:Envelope>
Any ideas?