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);
}
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;
}
Aggregations