1

I have created classes from WSDL2APEX, see my previous question for example: Test on WSDL2APEX classes.

But this is a different bunch of classes. The webservice in the example works well. I have read all the debug log, the only thing that is related to the error is:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: An unknown error has occurred. faultcode=s:Client faultactor=

Here I would like to ask, how do I locate what error is happening? Is there a way for me to get the details of the error?

Thanks a lot.

1 Answer 1

0

This will be a SOAP Fault coming back from the web service. Often this will include additional information about what caused the problem. Unfortunately, Apex doesn't currently let you see this all this information. Instead it gives you a truncated version.

You have a few of options:

  1. Vote for the idea SOAPFault Information for Apex and then wait for it to be delivered
  2. If you don't have time for the currently 7 year old idea to be delivered, grab the debug log and look for the CALLOUT_RESPONSE elements. These will include a JSON and a XML version of the SOAP Response. Here you can read the full SOAP FAULT.
  3. Or, similar to 2), capture the CALLOUT_REQUEST from the log and then replay it with a tool like SOAPUI to get the response.
  4. You could also make raw HTTP callouts from Apex and process the response XML yourself.
4
  • I had a try to locate callout_response elements in the Debug Log. There aren't elements labelled as callout_response. I will try other ways as well, but does this disappearing callout_response indicate anything?
    – Yifei Pei
    Commented Apr 21, 2016 at 23:30
  • I have solved this problem by the assistance from the other end. Thank you very much for your prompt answer.
    – Yifei Pei
    Commented Apr 22, 2016 at 2:44
  • I forgot to ask a question. Now I remembered. The webservice occasionally experiences timed out error. Is there a way for me to prevent the time out error happening?
    – Yifei Pei
    Commented Apr 22, 2016 at 5:28
  • @YifeiPei Try changing the timeout_x on the stub class. See Additional Considerations Commented Apr 22, 2016 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .