You need to sign in to do that
Don't have an account?
Saniya Khan 2
Soap Credential in apex callouts
Hi All,
I generated the apex classes from wsdl but didn't know how to specify credential.
here is code for that
public class Revenue_Management {
public String endpoint_x = 'Revenue_Management';
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[]{'urn:com.workday/bsvc','comWorkdayBsvc'};
public comWorkdayBsvc.Cash_SaleObjectType Cancel_Cash_Sale(comWorkdayBsvc.Cash_SaleObjectType Cash_Sale_Reference) {
comWorkdayBsvc.Cancel_Cash_Sale_RequestType request_x = new comWorkdayBsvc.Cancel_Cash_Sale_RequestType();
comWorkdayBsvc.Cancel_Cash_Sale_ResponseType response_x;
request_x.Cash_Sale_Reference = Cash_Sale_Reference;
Map<String, comWorkdayBsvc.Cancel_Cash_Sale_ResponseType> response_map_x = new Map<String, comWorkdayBsvc.Cancel_Cash_Sale_ResponseType>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'urn:com.workday/bsvc',
'Cancel_Cash_Sale_Request',
'urn:com.workday/bsvc',
'Cancel_Cash_Sale_Response',
'comWorkdayBsvc.Cancel_Cash_Sale_ResponseType'}
);
response_x = response_map_x.get('response_x');
return response_x.Cash_Sale_Reference;
}
It will will be grat if anyone will help me.
Many Thanks,
Saniya
I generated the apex classes from wsdl but didn't know how to specify credential.
here is code for that
public class Revenue_Management {
public String endpoint_x = 'Revenue_Management';
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[]{'urn:com.workday/bsvc','comWorkdayBsvc'};
public comWorkdayBsvc.Cash_SaleObjectType Cancel_Cash_Sale(comWorkdayBsvc.Cash_SaleObjectType Cash_Sale_Reference) {
comWorkdayBsvc.Cancel_Cash_Sale_RequestType request_x = new comWorkdayBsvc.Cancel_Cash_Sale_RequestType();
comWorkdayBsvc.Cancel_Cash_Sale_ResponseType response_x;
request_x.Cash_Sale_Reference = Cash_Sale_Reference;
Map<String, comWorkdayBsvc.Cancel_Cash_Sale_ResponseType> response_map_x = new Map<String, comWorkdayBsvc.Cancel_Cash_Sale_ResponseType>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'urn:com.workday/bsvc',
'Cancel_Cash_Sale_Request',
'urn:com.workday/bsvc',
'Cancel_Cash_Sale_Response',
'comWorkdayBsvc.Cancel_Cash_Sale_ResponseType'}
);
response_x = response_map_x.get('response_x');
return response_x.Cash_Sale_Reference;
}
It will will be grat if anyone will help me.
Many Thanks,
Saniya
Thanks for your reply.
just have one query why you are using response_x not request_x for response_x.inputHttpHeaders_x?
Many thanks.
Saniya
Its not working