I got two Apex classes Generated by wsdl2apex, GetCustomerServiceW and GetCustomerServiceT. I have tried the same WSDL with others SOAP clients on different languages and works fine, but I just can not figure out how to make it to work on Apex with Salesforce. I really appreciate any guidance on how to make the SOAP call to match with the GetCustomerServiceT class types.
In developer console, anonymous window I have tried:
SpectrumCustomersServiceW.GetCustomersPort client = new SpectrumCustomersServiceW.GetCustomersPort();
spectrumCustomersServiceT.returnArray_element customers =
client.GetCustomers('xxx','xxx','xxx','xxx');
but I get:
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element getCustomers.
Here below are the classes Generated by wsdl2apex:
public class spectrumCustomersServiceW {
public class GetCustomersPort {
public String endpoint_x = 'https://dexterchaney.com:8482/ws/GetCustomers';
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://www.northgate-is.com/proiv/webservices/types', 'spectrumCustomersServiceT', 'http://www.northgate-is.com/proiv/webservices/wsdl', 'spectrumCustomersServiceW'};
public spectrumCustomersServiceT.returnArray_element GetCustomers(String Authorization_ID,String GUID,String pCompany_Code,String pStatus) {
spectrumCustomersServiceT.GetCustomers_element request_x = new spectrumCustomersServiceT.GetCustomers_element();
request_x.Authorization_ID = Authorization_ID;
request_x.GUID = GUID;
request_x.pCompany_Code = pCompany_Code;
request_x.pStatus = pStatus;
spectrumCustomersServiceT.GetCustomersResponse_element response_x;
Map<String, spectrumCustomersServiceT.GetCustomersResponse_element> response_map_x = new Map<String, spectrumCustomersServiceT.GetCustomersResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'https://kernsteel.dexterchaney.com:8482/ws/GetCustomers',
'http://www.northgate-is.com/proiv/webservices/types',
'GetCustomers',
'http://www.northgate-is.com/proiv/webservices/types',
'GetCustomersResponse',
'spectrumCustomersServiceT.GetCustomersResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.returnArray;
}
}
}
Here is the spectrumCustomersServiceT
class
public class spectrumCustomersServiceT {
public class GetCustomersResponse_element {
public spectrumCustomersServiceT.returnArray_element returnArray;
private String[] returnArray_type_info = new String[]{'returnArray','http://www.northgate-is.com/proiv/webservices/types',null,'1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://www.northgate-is.com/proiv/webservices/types','false','false'};
private String[] field_order_type_info = new String[]{'returnArray'};
}
public class GetCustomers_element {
public String Authorization_ID;
public String GUID;
public String pCompany_Code;
public String pStatus;
private String[] Authorization_ID_type_info = new String[]{'Authorization_ID','http://www.northgate-is.com/proiv/webservices/types',null,'1','1','false'};
private String[] GUID_type_info = new String[]{'GUID','http://www.northgate-is.com/proiv/webservices/types',null,'1','1','false'};
private String[] pCompany_Code_type_info = new String[]{'pCompany_Code','http://www.northgate-is.com/proiv/webservices/types',null,'1','1','false'};
private String[] pStatus_type_info = new String[]{'pStatus','http://www.northgate-is.com/proiv/webservices/types',null,'1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://www.northgate-is.com/proiv/webservices/types','false','false'};
private String[] field_order_type_info = new String[]{'Authorization_ID','GUID','pCompany_Code','pStatus'};
}
public class returnData_element {
private String[] apex_schema_type_info = new String[]{'http://www.northgate-is.com/proiv/webservices/types','false','false'};
private String[] field_order_type_info = new String[]{};
}
public class returnArray_element {
public spectrumCustomersServiceT.returnData_element[] returnData;
private String[] returnData_type_info = new String[]{'returnData','http://www.northgate-is.com/proiv/webservices/types',null,'0','-1','false'};
private String[] apex_schema_type_info = new String[]{'http://www.northgate-is.com/proiv/webservices/types','false','false'};
private String[] field_order_type_info = new String[]{'returnData'};
}
}
I am being stuck for a while, any help tip, will be highly appreciated.