OutputMethod om = context.getOutputMethod();
boolean inSOAP = (im == InputMethod.SOAP);
boolean outSOAP = (inSOAP || om == OutputMethod.SOAP);
CatalogException exc;
try
{
if (inSOAP)
request = SOAPUtil.unembed(request);
Element response = dispatchI(request, context, cswServiceSpecificContraint);
if (outSOAP)
response = SOAPUtil.embed(response);
return response;
}
catch(CatalogException e)
{
exc = e;
}
catch(Exception e)
{
context.info("Exception stack trace : \n"+ Util.getStackTrace(e));
// TODO what's this ?
exc = new NoApplicableCodeEx(e.toString());
}
Element response = CatalogException.marshal(exc);
boolean sender = (exc instanceof NoApplicableCodeEx);
if (outSOAP)
return SOAPUtil.embedExc(response, sender, exc.getCode(), exc.toString());
//TODO: need to set the status code
return response;
}