I am looking at a strange exception when I make an apex callout to a external system. I am forming a very simple apex code to hit the endpoint using wsdl2Apex class. I get the below excception:
Exception:
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: [ISS.0088.9164] Access to WSDescriptor wsdl2apexClassName.webservices:wsdlName denied. faultcode=soapenv:Client faultactor=http://..endpoint
Apex Callout Code:
wsdl2apexclassName sample = new wsdl2apexclassName();
wsdl2apexclassName.input req = new wsdl2apexclassName.input();
sample.endpoint_x = 'the end point goes here';
sample.inputHttpHeaders_x = new Map<String, String>();
sample.inputHttpHeaders_x.put('Username','username');
sample.inputHttpHeaders_x.put('Password','pass');
wsdl2apexclassName.response res = sample.functionwhichhasInvokeMethod(req);
system.debug('******' + res);
WSDL has these information in the beginning:
> <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="wsdlName"
> targetNamespace="http://URL"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:soapjms="http://www.w3.org/2010/soapjms/"
> xmlns:tns="http://URL****"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
<wsdl:types>
......
DEbug log: CALLOUT_REQUEST
invokeMethod:[apex_schema_type_info=(http://endpoint, false, false), field_order_type_info=
(Input), Input=Input:[apex_schema_type_info=(http://targetURL, false, false),
field_order_type_info=(listOfPfOrderOutboundIo), listOfPfOrderOutboundIo=null,
listOfPfOrderOutboundIo_type_info=(listOfPfOrderOutboundIo,
http://targetURL, null, 1, 1,
false)], orderInput_type_info=(Input,
http://targetURL, null, 1, 1,
true)]::SOAPAction="SOAPAction"
Accept=text/xml Username=usernamee**** User-Agent=SFDC-Callout/38.0 SFDC_STACK_DEPTH=1
Password=**** Content-Type=text/xml; charset=UTF-8
CALLOUT_REQUEST
that will show you the envelope being sent.sample
actually a proxy class likewsdl2apexClassName.webservices
. I say odd because it is usually an inner class that contains the web method proxies.