Search in sources :

Example 1 with ActionNotSupportedException

use of com.sun.xml.ws.addressing.model.ActionNotSupportedException in project metro-jax-ws by eclipse-ee4j.

the class WsaClientTube method validateAction.

@Override
protected void validateAction(Packet packet) {
    // There may not be a WSDL operation.  There may not even be a WSDL.
    // For instance this may be a RM CreateSequence message.
    WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
    if (wbo == null)
        return;
    String gotA = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION());
    String expected = helper.getOutputAction(packet);
    if (expected != null && !gotA.equals(expected))
        throw new ActionNotSupportedException(gotA);
}
Also used : WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) WebServiceException(jakarta.xml.ws.WebServiceException) ActionNotSupportedException(com.sun.xml.ws.addressing.model.ActionNotSupportedException)

Example 2 with ActionNotSupportedException

use of com.sun.xml.ws.addressing.model.ActionNotSupportedException in project metro-jax-ws by eclipse-ee4j.

the class WsaServerTube method validateAction.

@Override
protected void validateAction(Packet packet) {
    // There may not be a WSDL operation.  There may not even be a WSDL.
    // For instance this may be a RM CreateSequence message.
    WSDLBoundOperation wsdlBoundOperation = getWSDLBoundOperation(packet);
    if (wsdlBoundOperation == null) {
        return;
    }
    String gotA = AddressingUtils.getAction(packet.getMessage().getHeaders(), addressingVersion, soapVersion);
    if (gotA == null) {
        throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
    }
    String expected = helper.getInputAction(packet);
    String soapAction = helper.getSOAPAction(packet);
    if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals(""))) {
        expected = soapAction;
    }
    if (expected != null && !gotA.equals(expected)) {
        throw new ActionNotSupportedException(gotA);
    }
}
Also used : WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) WebServiceException(jakarta.xml.ws.WebServiceException) ActionNotSupportedException(com.sun.xml.ws.addressing.model.ActionNotSupportedException)

Aggregations

ActionNotSupportedException (com.sun.xml.ws.addressing.model.ActionNotSupportedException)2 WSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation)2 WebServiceException (jakarta.xml.ws.WebServiceException)2