Search in sources :

Example 1 with SoapFaultPortType

use of org.jboss.jbossts.xts.soapfault.SoapFaultPortType in project narayana by jbosstm.

the class SoapFaultClient method sendSoapFault.

/**
 * Send a fault.
 * @param soapFault The SOAP fault.
 * @param map addressing context initialised with to and message ID.
 * @param action The action URI for the request.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public static void sendSoapFault(final SoapFault11 soapFault, final MAP map, final String action) throws SoapFault11, IOException {
    if (action != null) {
        soapFault.setAction(action);
    }
    final SoapFaultPortType faultPort = getSoapFaultPort(map, action);
    Fault fault = soapFault.toFault();
    faultPort.soapFault(fault);
}
Also used : Fault(org.xmlsoap.schemas.soap.envelope.Fault) SoapFaultPortType(org.jboss.jbossts.xts.soapfault.SoapFaultPortType)

Example 2 with SoapFaultPortType

use of org.jboss.jbossts.xts.soapfault.SoapFaultPortType in project narayana by jbosstm.

the class SoapFaultClient method getSoapFaultPort.

private static org.jboss.jbossts.xts.soapfault.SoapFaultPortType getSoapFaultPort(final MAP map, final String action) {
    SoapFaultService service = getSoapFaultService();
    SoapFaultPortType port = service.getPort(org.jboss.jbossts.xts.soapfault.SoapFaultPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
         */
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    if (action != null) {
        map.setAction(action);
    }
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) SoapFaultService(org.jboss.jbossts.xts.soapfault.SoapFaultService) SoapFaultPortType(org.jboss.jbossts.xts.soapfault.SoapFaultPortType) BindingProvider(javax.xml.ws.BindingProvider)

Aggregations

SoapFaultPortType (org.jboss.jbossts.xts.soapfault.SoapFaultPortType)2 BindingProvider (javax.xml.ws.BindingProvider)1 AddressingFeature (javax.xml.ws.soap.AddressingFeature)1 SoapFaultService (org.jboss.jbossts.xts.soapfault.SoapFaultService)1 Fault (org.xmlsoap.schemas.soap.envelope.Fault)1