středa 18. ledna 2017

Vyhození fault Java komponenty v Integration Designer







/**
* Method generated to support implementation of operation "operation1" defined for WSDL port type
* named "SimpleIntf".
*
* The presence of commonj.sdo.DataObject as the return type and/or as a parameter
* type conveys that it is a complex type. Please refer to the WSDL Definition for more information
* on the type of input, output and fault(s).
*/
public DataObject operation1(DataObject input1) throws Throwable{
Service service = locateService_SimpleIntfPartner();
try {
service.invoke("operation1", input1);
} catch (Throwable t) {
System.out.println("Nastala chyba");
com.ibm.websphere.bo.BOFactory boFactory = (com.ibm.websphere.bo.BOFactory) ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOFactory");
DataObject fault = boFactory.create("http://JMSDemoModule", "ServiceFault");
fault.setString("error", t.getMessage());
throw new ServiceBusinessException(fault);
}

return input1;
}

Žádné komentáře:

Okomentovat