You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Supporting Business Exceptions

1. How to declare business exceptions?

What defines business exception on each interface type. (ie Java wsdl)
In Java interface, business exceptions are declared checked exceptions specified on the operations of the services interface.
Note declared unchecked (runtime) exceptions are not considered business exceptions.
WSDL need to determine if all WSDL defined faults are business exceptions. Need to in investigate JAX-WS mapping of exceptions JAX-B databinding..
SDO has no similar specification. Need to determine a similar means for SDO to provide reliable transforms between JAX-B and SDO.

2. How to represent business exceptions in Java?

In Java business exception are represented as non runtime exceptions. But not all runtime exceptions delivered in a message maybe a Business exception.
If a non runtime exceptions is delivered to a component that is does not declare the exception the exception will be wrappered in a specified runtime exception.
Jax-b need to further investigate the JAX-B specification and follow how it models business exceptions as objects.
SDO there are no specific mappings provided for. May need to wrapper complex parts of an exception as SDO objects in a specific Java exception.

JAX-WS WSDL1.1 to Java mapping for faults

JAX-WS 2.0 spec defines the mapping rule for web service faults in section 2.5.

Using java exception to represent the Web Service fault:

/**
 * The java exception to represent the web service fault
 */
public class WebServiceFault extends Exception {
    private static final long serialVersionUID = -3134446726685504039L;    
    private Object fault;    

    public WebServiceFault(String message, Object fault) {
        super(message);
        this.fault = fault;
    }    

    public WebServiceFault(String message, Object fault, Throwable cause) {
        super(message, cause);
        this.fault = fault;
    }    

    public Object getFault() {
        return fault;
    }
}

3. How to transform business exceptions across databindings?

Provide in the data binding transformations between Axiom OMElement, SDO represented faults and JAX-B exceptions.
How to identify as business exceptions during the transforms.

4. How to propagate business exceptions?

Determine how to propagate exception in the Tuscany runtime message in local interactions. Make sure TargetInvocation exceptions become unwrappered
How in the case of webservice's binding propagate the message through web service binding.

  • No labels