I want to encapsulate a WebServiceCallout.invoke
to reuse it in various cases, so I've build the following static method
public static Object callSOAP(Object stub, Object request_x, Map<String, Object> response_map_x, Object response_x, String endpoint_x, String soapAction, String reqNameSpace, String reqName, String resNameSpace, String resName, String resType) {
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
stub,
request_x,
response_map_x,
new String[]{
endpoint_x,
soapAction,
reqNameSpace,
reqName,
resNameSpace,
resName,
resType
}
);
response_x = response_map_x.get('response_x');
return response_x;
}
However when I try to save this I get the following error:
Variable does not exist: WebServiceCallout
Like if some parameter is not valid and the system's class is not being recognised. According to the docs the parameters type are correct so no idea why this is failing or is there something I'm missing?.