Good morning, I have a wsdl that I generated with salesforce, but when I call some methods I get this error:
EXCEPTION_THROWN [157]|System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element =entry
the class that SFDC generate is:
//Generated by wsdl2apex
public class serviceIdaCombaseCl2 {
public class sendSmsO {
public String in0;
public String in1;
public String in2;
public String in3;
public String in4;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in2_type_info = new String[]{'in2','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in3_type_info = new String[]{'in3','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in4_type_info = new String[]{'in4','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1','in2','in3','in4'};
}
public class sendSmsOResponse {
public serviceIdaCombaseCl2.StringStringMap out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class getCarrierResponse {
public String out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class StringStringMap {
public serviceIdaCombaseCl2.IdentifiedUser[] entry;
private String[] entry_type_info = new String[]{'entry','http://service.ida.combase.cl/',null,'0','-1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'entry'};
}
public class IdentifiedUser {
public String key;
public String value;
private String[] key_type_info = new String[]{'key','http://service.ida.combase.cl/',null,'1','1','false'};
private String[] value_type_info = new String[]{'value','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'key','value'};
}
public class getRecievedMessages {
public String in0;
public String in1;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1'};
}
public class sendSmsResponse {
public serviceIdaCombaseCl2.StringStringMap out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class sendSms {
public String in0;
public String in1;
public String in2;
public String in3;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in2_type_info = new String[]{'in2','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in3_type_info = new String[]{'in3','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1','in2','in3'};
}
public class getRecievedMessagesResponse {
public String out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class smsStatus {
public String in0;
public String in1;
public String in2;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in2_type_info = new String[]{'in2','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1','in2'};
}
public class getCredits {
public String in0;
public String in1;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1'};
}
public class getCarrier {
public String in0;
public String in1;
public String in2;
private String[] in0_type_info = new String[]{'in0','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in1_type_info = new String[]{'in1','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] in2_type_info = new String[]{'in2','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'in0','in1','in2'};
}
public class getCreditsResponse {
public String out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class smsStatusResponse {
public serviceIdaCombaseCl2.StringStringMap out;
private String[] out_type_info = new String[]{'out','http://service.ida.combase.cl/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://service.ida.combase.cl/','true','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class SmsApiManagerImplPort {
public String endpoint_x = 'https://ida.itdchile.cl/services/smsApiService';
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://service.ida.combase.cl/', 'serviceIdaCombaseCl2'};
public serviceIdaCombaseCl2.StringStringMap sendSms(String in0,String in1,String in2,String in3) {
serviceIdaCombaseCl2.sendSms request_x = new serviceIdaCombaseCl2.sendSms();
request_x.in0 = in0;
request_x.in1 = in1;
request_x.in2 = in2;
request_x.in3 = in3;
serviceIdaCombaseCl2.sendSmsResponse response_x;
Map<String, serviceIdaCombaseCl2.sendSmsResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.sendSmsResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'sendSms',
'http://service.ida.combase.cl/',
'sendSmsResponse',
'serviceIdaCombaseCl2.sendSmsResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
public serviceIdaCombaseCl2.StringStringMap smsStatus(String in0,String in1,String in2) {
serviceIdaCombaseCl2.smsStatus request_x = new serviceIdaCombaseCl2.smsStatus();
request_x.in0 = in0;
request_x.in1 = in1;
request_x.in2 = in2;
serviceIdaCombaseCl2.smsStatusResponse response_x;
Map<String, serviceIdaCombaseCl2.smsStatusResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.smsStatusResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'smsStatus',
'http://service.ida.combase.cl/',
'smsStatusResponse',
'serviceIdaCombaseCl2.smsStatusResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
public serviceIdaCombaseCl2.StringStringMap sendSmsO(String in0,String in1,String in2,String in3,String in4) {
serviceIdaCombaseCl2.sendSmsO request_x = new serviceIdaCombaseCl2.sendSmsO();
request_x.in0 = in0;
request_x.in1 = in1;
request_x.in2 = in2;
request_x.in3 = in3;
request_x.in4 = in4;
serviceIdaCombaseCl2.sendSmsOResponse response_x;
Map<String, serviceIdaCombaseCl2.sendSmsOResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.sendSmsOResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'sendSmsO',
'http://service.ida.combase.cl/',
'sendSmsOResponse',
'serviceIdaCombaseCl2.sendSmsOResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
public String getCarrier(String in0,String in1,String in2) {
serviceIdaCombaseCl2.getCarrier request_x = new serviceIdaCombaseCl2.getCarrier();
request_x.in0 = in0;
request_x.in1 = in1;
request_x.in2 = in2;
serviceIdaCombaseCl2.getCarrierResponse response_x;
Map<String, serviceIdaCombaseCl2.getCarrierResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.getCarrierResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'getCarrier',
'http://service.ida.combase.cl/',
'getCarrierResponse',
'serviceIdaCombaseCl2.getCarrierResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
public String getCredits(String in0,String in1) {
serviceIdaCombaseCl2.getCredits request_x = new serviceIdaCombaseCl2.getCredits();
request_x.in0 = in0;
request_x.in1 = in1;
serviceIdaCombaseCl2.getCreditsResponse response_x;
Map<String, serviceIdaCombaseCl2.getCreditsResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.getCreditsResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'getCredits',
'http://service.ida.combase.cl/',
'getCreditsResponse',
'serviceIdaCombaseCl2.getCreditsResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
public String getRecievedMessages(String in0,String in1) {
serviceIdaCombaseCl2.getRecievedMessages request_x = new serviceIdaCombaseCl2.getRecievedMessages();
request_x.in0 = in0;
request_x.in1 = in1;
serviceIdaCombaseCl2.getRecievedMessagesResponse response_x;
Map<String, serviceIdaCombaseCl2.getRecievedMessagesResponse> response_map_x = new Map<String, serviceIdaCombaseCl2.getRecievedMessagesResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://service.ida.combase.cl/',
'getRecievedMessages',
'http://service.ida.combase.cl/',
'getRecievedMessagesResponse',
'serviceIdaCombaseCl2.getRecievedMessagesResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
}
}
This is the response I get when I tried in SOAP UI:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:smsStatusResponse xmlns:ns1="http://service.ida.combase.cl/">
<ns1:out>
<entry>
<key>MESSAGE</key>
<value>CONFIRMED DELIVERY</value>
</entry>
<entry>
<key>DELIVERYDATE</key>
<value>2018-06-14 13:46:30.0</value>
</entry>
<entry>
<key>STATUS</key>
<value>OK</value>
</entry>
<entry>
<key>CODE</key>
<value>0</value>
</entry>
</ns1:out>
</ns1:smsStatusResponse>
</soap:Body>
</soap:Envelope>
Any one have a workaround about this error?
smsStatusResponse
was defined as<soap:body use="literal"/>
rather than defining themessage
attribute for the type of the response.entry
,key
, andvalue
to have thehttp://service.ida.combase.cl/
namespace in the response.