com.sun.xml.internal.ws.resources.AddressingMessages Java Examples

The following examples show how to use com.sun.xml.internal.ws.resources.AddressingMessages. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddressingUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getFaultTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.faultToTag, true, sv);
    WSEndpointReference faultTo = null;
    if (h != null) {
        try {
            faultTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
        }
    }

    return faultTo;
}
 
Example #2
Source File: WsaClientTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #3
Source File: AddressingUtils.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getReplyTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.replyToTag, true, sv);
    WSEndpointReference replyTo;
    if (h != null) {
        try {
            replyTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
        }
    } else {
        replyTo = av.anonymousEpr;
    }

    return replyTo;
}
 
Example #4
Source File: AddressingUtils.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getFaultTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.faultToTag, true, sv);
    WSEndpointReference faultTo = null;
    if (h != null) {
        try {
            faultTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
        }
    }

    return faultTo;
}
 
Example #5
Source File: WsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #6
Source File: WsaClientTube.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #7
Source File: AddressingUtils.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getFaultTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.faultToTag, true, sv);
    WSEndpointReference faultTo = null;
    if (h != null) {
        try {
            faultTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
        }
    }

    return faultTo;
}
 
Example #8
Source File: AddressingUtils.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getFaultTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.faultToTag, true, sv);
    WSEndpointReference faultTo = null;
    if (h != null) {
        try {
            faultTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
        }
    }

    return faultTo;
}
 
Example #9
Source File: AddressingUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getFaultTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.faultToTag, true, sv);
    WSEndpointReference faultTo = null;
    if (h != null) {
        try {
            faultTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
        }
    }

    return faultTo;
}
 
Example #10
Source File: AddressingUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getReplyTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.replyToTag, true, sv);
    WSEndpointReference replyTo;
    if (h != null) {
        try {
            replyTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
        }
    } else {
        replyTo = av.anonymousEpr;
    }

    return replyTo;
}
 
Example #11
Source File: AddressingUtils.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getReplyTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.replyToTag, true, sv);
    WSEndpointReference replyTo;
    if (h != null) {
        try {
            replyTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
        }
    } else {
        replyTo = av.anonymousEpr;
    }

    return replyTo;
}
 
Example #12
Source File: AddressingUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static WSEndpointReference getReplyTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.replyToTag, true, sv);
    WSEndpointReference replyTo;
    if (h != null) {
        try {
            replyTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
        }
    } else {
        replyTo = av.anonymousEpr;
    }

    return replyTo;
}
 
Example #13
Source File: WsaClientTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #14
Source File: WsaServerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #15
Source File: AddressingUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) {
    if (sv == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION());
    }

    Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood);
    while (iter.hasNext()) {
        Header h = iter.next();
        if (h.getRole(sv).equals(sv.implicitRole)) {
            return h;
        }
    }

    return null;
}
 
Example #16
Source File: WsaServerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #17
Source File: WsaTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void validateSOAPAction(Packet packet) {
    String gotA = AddressingUtils.getAction(
            packet.getMessage().getHeaders(),
            addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
    if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
        throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
    }
}
 
Example #18
Source File: AddressingUtils.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String getTo(MessageHeaders headers, AddressingVersion av, SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.toTag, true, sv);
    String to;
    if (h != null) {
        to = h.getStringContent();
    } else {
        to = av.anonymousUri;
    }

    return to;
}
 
Example #19
Source File: AddressingUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) {
    if (sv == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION());
    }

    Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood);
    while (iter.hasNext()) {
        Header h = iter.next();
        if (h.getRole(sv).equals(sv.implicitRole)) {
            return h;
        }
    }

    return null;
}
 
Example #20
Source File: AddressingUtils.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static Header getFirstHeader(MessageHeaders headers, QName name, boolean markUnderstood, SOAPVersion sv) {
    if (sv == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION());
    }

    Iterator<Header> iter = headers.getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood);
    while (iter.hasNext()) {
        Header h = iter.next();
        if (h.getRole(sv).equals(sv.implicitRole)) {
            return h;
        }
    }

    return null;
}
 
Example #21
Source File: WsaTube.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void validateSOAPAction(Packet packet) {
    String gotA = AddressingUtils.getAction(
            packet.getMessage().getHeaders(),
            addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
    if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
        throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
    }
}
 
Example #22
Source File: WsaServerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #23
Source File: AddressingUtils.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String getMessageID(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.messageIDTag, true, sv);
    String messageId = null;
    if (h != null) {
        messageId = h.getStringContent();
    }

    return messageId;
}
 
Example #24
Source File: AddressingUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static String getMessageID(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.messageIDTag, true, sv);
    String messageId = null;
    if (h != null) {
        messageId = h.getStringContent();
    }

    return messageId;
}
 
Example #25
Source File: AddressingUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static String getAction(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    String action = null;
    Header h = getFirstHeader(headers, av.actionTag, true, sv);
    if (h != null) {
        action = h.getStringContent();
    }

    return action;
}
 
Example #26
Source File: AddressingUtils.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static String getAction(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    String action = null;
    Header h = getFirstHeader(headers, av.actionTag, true, sv);
    if (h != null) {
        action = h.getStringContent();
    }

    return action;
}
 
Example #27
Source File: WsaServerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #28
Source File: WsaTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void validateSOAPAction(Packet packet) {
    String gotA = AddressingUtils.getAction(
            packet.getMessage().getHeaders(),
            addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
    if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
        throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
    }
}
 
Example #29
Source File: WsaServerTube.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #30
Source File: AddressingUtils.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static String getRelatesTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.relatesToTag, true, sv);
    String relatesTo = null;
    if (h != null) {
        relatesTo = h.getStringContent();
    }

    return relatesTo;
}