use of com.sun.xml.ws.client.HandlerConfiguration in project metro-jax-ws by eclipse-ee4j.
the class ClientMUTube method processResponse.
/**
* Do MU Header Processing on incoming message (response)
*
* @return
* if all the headers in the packet are understood, returns an action to
* call the previous pipes with response packet
* @throws SOAPFaultException
* if all the headers in the packet are not understood, throws SOAPFaultException
*/
@Override
@NotNull
public NextAction processResponse(Packet response) {
if (response.getMessage() == null) {
return super.processResponse(response);
}
HandlerConfiguration handlerConfig = response.handlerConfig;
if (handlerConfig == null) {
// Use from binding instead of defaults in case response packet does not have it,
// may have been changed from the time of invocation, it ok as its only fallback case.
handlerConfig = binding.getHandlerConfig();
}
Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(), binding.getKnownHeaders());
if ((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
return super.processResponse(response);
}
throw createMUSOAPFaultException(misUnderstoodHeaders);
}
use of com.sun.xml.ws.client.HandlerConfiguration in project metro-jax-ws by eclipse-ee4j.
the class ServerMessageHandlerTube method setUpHandlersOnce.
private void setUpHandlersOnce() {
handlers = new ArrayList<>();
HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
List<MessageHandler> msgHandlersSnapShot = handlerConfig.getMessageHandlers();
if (!msgHandlersSnapShot.isEmpty()) {
handlers.addAll(msgHandlersSnapShot);
roles = new HashSet<>();
roles.addAll(handlerConfig.getRoles());
}
}
use of com.sun.xml.ws.client.HandlerConfiguration in project metro-jax-ws by eclipse-ee4j.
the class ServerSOAPHandlerTube method setUpHandlersOnce.
private void setUpHandlersOnce() {
handlers = new ArrayList<>();
HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
List<SOAPHandler> soapSnapShot = handlerConfig.getSoapHandlers();
if (!soapSnapShot.isEmpty()) {
handlers.addAll(soapSnapShot);
roles = new HashSet<>();
roles.addAll(handlerConfig.getRoles());
}
}
use of com.sun.xml.ws.client.HandlerConfiguration in project metro-jax-ws by eclipse-ee4j.
the class SOAPBindingImpl method setRoles.
/**
* Adds the next and other roles in case this has
* been called by a user without them.
* Creates a new HandlerConfiguration object and sets it on the BindingImpl.
*/
public void setRoles(Set<String> roles) {
if (roles == null) {
roles = new HashSet<>();
}
if (roles.contains(ROLE_NONE)) {
throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
}
addRequiredRoles(roles);
setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig()));
}
use of com.sun.xml.ws.client.HandlerConfiguration in project metro-jax-ws by eclipse-ee4j.
the class ClientMessageHandlerTube method setUpProcessor.
void setUpProcessor() {
if (handlers == null) {
// Take a snapshot, User may change chain after invocation, Same chain
// should be used for the entire MEP
handlers = new ArrayList<>();
HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
List<MessageHandler> msgHandlersSnapShot = handlerConfig.getMessageHandlers();
if (!msgHandlersSnapShot.isEmpty()) {
handlers.addAll(msgHandlersSnapShot);
roles = new HashSet<>();
roles.addAll(handlerConfig.getRoles());
processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
}
}
}
Aggregations