Example usage for javax.xml.ws ProtocolException ProtocolException

List of usage examples for javax.xml.ws ProtocolException ProtocolException

Introduction

In this page you can find the example usage for javax.xml.ws ProtocolException ProtocolException.

Prototype

public ProtocolException(Throwable cause) 

Source Link

Document

Constructs a new runtime exception with the specified cause and a detail message of (cause==null ?

Usage

From source file:be.agiv.security.handler.WSAddressingHandler.java

private void handleInboundMessage(SOAPMessageContext context) {
    String messageId = (String) context.get(MESSAGE_ID_CONTEXT_ATTRIBUTE);
    LOG.debug("checking RelatesTo message id: " + messageId);
    Object[] headers = context.getHeaders(new QName(WSConstants.WS_ADDR_NAMESPACE, "RelatesTo"),
            this.jaxbContext, false);
    for (Object headerObject : headers) {
        JAXBElement<RelatesToType> element = (JAXBElement<RelatesToType>) headerObject;
        RelatesToType relatesTo = element.getValue();
        if (false == messageId.equals(relatesTo.getValue())) {
            throw new ProtocolException("incorrect a:RelatesTo value");
        }//from  w ww  .  j  av  a 2  s.c o m
    }
}

From source file:test.integ.be.fedict.hsm.ws.WSS4JTestSOAPHandler.java

@Override
public boolean handleMessage(SOAPMessageContext context) {
    Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (true == outboundProperty.booleanValue()) {
        try {/*w  ww .ja  v  a  2s . c o m*/
            handleOutboundMessage(context);
        } catch (Exception e) {
            LOG.debug("error adding WS-Security header: " + e.getMessage(), e);
            throw new ProtocolException(e);
        }
    }
    return true;
}

From source file:test.unit.be.e_contract.dssp.client.WSSecuritySOAPHandler.java

@Override
public boolean handleMessage(SOAPMessageContext context) {
    Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (false == outboundProperty.booleanValue()) {
        try {//from  ww  w  . j  ava2  s . c om
            handleInboundMessage(context);
        } catch (Exception e) {
            throw new ProtocolException(e);
        }
    }
    return true;
}