Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to check error type in accessing web service?

Avatar

Level 3

Dear all,

I have created a form using WSDL connection to access web service in SOAP protocol.

But I have difficulties in error handling when acccessing web service.

I try to put a try catch block for the following statement :
ie. xfa.connectionSet.WebServiceDC.execute(false);
in case for any error, I can only catch message saying GeneralFault only.

Is there any extra object in the script that I can catch to handle for different error type?
e.g checking SOAP.? and where should I put the codes in?

Actualy I want to detect if network connection is not ok or if it fails to find ecert which is required under https connection


Rgds.

1 Reply

Avatar

Former Community Member

Have you tried the try catch block ?

See the error codes it responds with.

Then look through the properties of the Exception

try
{
    doInit();
} catch(err)
{
    var vDebug = "";
    for (var prop in err)
    { 
       vDebug += "property: "+ prop+ " value: ["+ err[prop]+ "]\n";
    }
    vDebug += "toString(): " + " value: [" + err.toString() + "]";
    status.rawValue = vDebug;
}

function doInit()
{
    doWebServiceCallThatFails();
}

Have fun with these articles

http://blogs.adobe.com/formfeed/2009/06/collected_form_development_and.html

http://blogs.adobe.com/formfeed/2009/03/handling_javascript_exceptions.html