com.sun.xml.internal.ws.addressing.W3CAddressingMetadataConstants Java Examples

The following examples show how to use com.sun.xml.internal.ws.addressing.W3CAddressingMetadataConstants. 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: WSEndpointReference.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #2
Source File: WSEndpointReference.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #3
Source File: WSEndpointReference.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #4
Source File: WSEndpointReference.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #5
Source File: WSEndpointReference.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #6
Source File: WSEndpointReference.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #7
Source File: WSEndpointReference.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #8
Source File: WSEndpointReference.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param writer the writer should be at the start of element.
 * @param service Namespace URI of servcie is used as targetNamespace of wsdl if wsdlTargetNamespace is not null
 * @param wsdlAddress  wsdl location
 * @param wsdlTargetNamespace  targetnamespace of wsdl to be put in wsdliLocation
 *
 */
private static void writeWsdliLocation(StreamWriterBufferCreator writer, QName service,String wsdlAddress,String wsdlTargetNamespace) throws XMLStreamException {
    String wsdliLocation = "";
    if(wsdlTargetNamespace != null) {
       wsdliLocation = wsdlTargetNamespace + " ";
    } else if (service != null) {
        wsdliLocation = service.getNamespaceURI() + " ";
    } else {
        throw new WebServiceException("WSDL target Namespace cannot be resolved");
    }
    wsdliLocation += wsdlAddress;
    writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
        W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE);
    writer.writeAttribute(W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_PREFIX,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_NAMESPACE,
            W3CAddressingMetadataConstants.WSAM_WSDLI_ATTRIBUTE_LOCALNAME,
            wsdliLocation);

}
 
Example #9
Source File: AddressingPolicyValidator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #10
Source File: AddressingPolicyValidator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #11
Source File: AddressingPolicyValidator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #12
Source File: AddressingPolicyValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #13
Source File: AddressingPolicyValidator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #14
Source File: AddressingPolicyValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #15
Source File: AddressingPolicyValidator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #16
Source File: AddressingPolicyValidator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example #17
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private boolean fail(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
    return false;
}
 
Example #18
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void warn(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
}
 
Example #19
Source File: AddressingPolicyValidator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public String[] declareSupportedDomains() {
    return new String[]{AddressingVersion.MEMBER.policyNsUri, AddressingVersion.W3C.policyNsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME};
}
 
Example #20
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void warn(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
}
 
Example #21
Source File: WSEndpointReference.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void writeW3CMetaData(StreamWriterBufferCreator writer,
                                     QName service,
                                     QName port,
                                     QName portType, List<Element> metadata,
                                     String wsdlAddress, String wsdlTargetNamespace) throws XMLStreamException {


    //.NET treate empty metaData element as bad request.
    if (isEmty(service) && isEmty(port) && isEmty(portType) && metadata == null/* && wsdlAddress == null*/) {
        return;
    }

    writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
            AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri);
    writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
            AddressingVersion.W3C.wsdlNsUri);
    //write wsdliLication as defined in WS-Addressing 1.0 Metadata spec
    if(wsdlAddress != null) {
        writeWsdliLocation(writer, service, wsdlAddress, wsdlTargetNamespace);
    }

    //Write Interface info
    if (portType != null) {
        writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                AddressingVersion.W3C.eprType.portTypeName,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
            W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        String portTypePrefix = portType.getPrefix();
        if (portTypePrefix == null || portTypePrefix.equals("")) {
            //TODO check prefix again
            portTypePrefix = "wsns";
        }
        writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
        writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
        writer.writeEndElement();
    }
    if (service != null) {
        //Write service and Port info
        if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
            writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                    AddressingVersion.W3C.eprType.serviceName,
                    W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            String servicePrefix = service.getPrefix();
            if (servicePrefix == null || servicePrefix.equals("")) {
                //TODO check prefix again
                servicePrefix = "wsns";
            }
            writer.writeNamespace(servicePrefix, service.getNamespaceURI());
            if (port != null) {
                writer.writeAttribute(AddressingVersion.W3C.eprType.portName, port.getLocalPart());
            }
            writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
            writer.writeEndElement();
        }
    }
    /*
    //Inline the wsdl
    if (wsdlAddress != null) {
        writeWsdl(writer, service, wsdlAddress);
    }
    */
    //Add the extra metadata Elements
    if (metadata != null) {
        for (Element e : metadata) {
            DOMUtil.serializeNode(e, writer);
        }
    }
    writer.writeEndElement();

}
 
Example #22
Source File: WSEndpointReference.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private static void writeW3CMetaData(StreamWriterBufferCreator writer,
                                     QName service,
                                     QName port,
                                     QName portType, List<Element> metadata,
                                     String wsdlAddress, String wsdlTargetNamespace) throws XMLStreamException {


    //.NET treate empty metaData element as bad request.
    if (isEmty(service) && isEmty(port) && isEmty(portType) && metadata == null/* && wsdlAddress == null*/) {
        return;
    }

    writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
            AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri);
    writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
            AddressingVersion.W3C.wsdlNsUri);
    //write wsdliLication as defined in WS-Addressing 1.0 Metadata spec
    if(wsdlAddress != null) {
        writeWsdliLocation(writer, service, wsdlAddress, wsdlTargetNamespace);
    }

    //Write Interface info
    if (portType != null) {
        writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                AddressingVersion.W3C.eprType.portTypeName,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
            W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        String portTypePrefix = portType.getPrefix();
        if (portTypePrefix == null || portTypePrefix.equals("")) {
            //TODO check prefix again
            portTypePrefix = "wsns";
        }
        writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
        writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
        writer.writeEndElement();
    }
    if (service != null) {
        //Write service and Port info
        if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
            writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                    AddressingVersion.W3C.eprType.serviceName,
                    W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            String servicePrefix = service.getPrefix();
            if (servicePrefix == null || servicePrefix.equals("")) {
                //TODO check prefix again
                servicePrefix = "wsns";
            }
            writer.writeNamespace(servicePrefix, service.getNamespaceURI());
            if (port != null) {
                writer.writeAttribute(AddressingVersion.W3C.eprType.portName, port.getLocalPart());
            }
            writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
            writer.writeEndElement();
        }
    }
    /*
    //Inline the wsdl
    if (wsdlAddress != null) {
        writeWsdl(writer, service, wsdlAddress);
    }
    */
    //Add the extra metadata Elements
    if (metadata != null) {
        for (Element e : metadata) {
            DOMUtil.serializeNode(e, writer);
        }
    }
    writer.writeEndElement();

}
 
Example #23
Source File: MemberSubmissionAddressingExtensionHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void warn(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
}
 
Example #24
Source File: MemberSubmissionAddressingExtensionHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private boolean fail(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
    return false;
}
 
Example #25
Source File: AddressingPolicyValidator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public String[] declareSupportedDomains() {
    return new String[]{AddressingVersion.MEMBER.policyNsUri, AddressingVersion.W3C.policyNsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME};
}
 
Example #26
Source File: AddressingPolicyValidator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public String[] declareSupportedDomains() {
    return new String[]{AddressingVersion.MEMBER.policyNsUri, AddressingVersion.W3C.policyNsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME};
}
 
Example #27
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private boolean fail(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
    return false;
}
 
Example #28
Source File: WSEndpointReference.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void writeW3CMetaData(StreamWriterBufferCreator writer,
                                     QName service,
                                     QName port,
                                     QName portType, List<Element> metadata,
                                     String wsdlAddress, String wsdlTargetNamespace) throws XMLStreamException {


    //.NET treate empty metaData element as bad request.
    if (isEmty(service) && isEmty(port) && isEmty(portType) && metadata == null/* && wsdlAddress == null*/) {
        return;
    }

    writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
            AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri);
    writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
            AddressingVersion.W3C.wsdlNsUri);
    //write wsdliLication as defined in WS-Addressing 1.0 Metadata spec
    if(wsdlAddress != null) {
        writeWsdliLocation(writer, service, wsdlAddress, wsdlTargetNamespace);
    }

    //Write Interface info
    if (portType != null) {
        writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                AddressingVersion.W3C.eprType.portTypeName,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
            W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        String portTypePrefix = portType.getPrefix();
        if (portTypePrefix == null || portTypePrefix.equals("")) {
            //TODO check prefix again
            portTypePrefix = "wsns";
        }
        writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
        writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
        writer.writeEndElement();
    }
    if (service != null) {
        //Write service and Port info
        if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
            writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                    AddressingVersion.W3C.eprType.serviceName,
                    W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            String servicePrefix = service.getPrefix();
            if (servicePrefix == null || servicePrefix.equals("")) {
                //TODO check prefix again
                servicePrefix = "wsns";
            }
            writer.writeNamespace(servicePrefix, service.getNamespaceURI());
            if (port != null) {
                writer.writeAttribute(AddressingVersion.W3C.eprType.portName, port.getLocalPart());
            }
            writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
            writer.writeEndElement();
        }
    }
    /*
    //Inline the wsdl
    if (wsdlAddress != null) {
        writeWsdl(writer, service, wsdlAddress);
    }
    */
    //Add the extra metadata Elements
    if (metadata != null) {
        for (Element e : metadata) {
            DOMUtil.serializeNode(e, writer);
        }
    }
    writer.writeEndElement();

}
 
Example #29
Source File: WSEndpointReference.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static void writeW3CMetaData(StreamWriterBufferCreator writer,
                                     QName service,
                                     QName port,
                                     QName portType, List<Element> metadata,
                                     String wsdlAddress, String wsdlTargetNamespace) throws XMLStreamException {


    //.NET treate empty metaData element as bad request.
    if (isEmty(service) && isEmty(port) && isEmty(portType) && metadata == null/* && wsdlAddress == null*/) {
        return;
    }

    writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
            AddressingVersion.W3C.eprType.wsdlMetadata.getLocalPart(), AddressingVersion.W3C.nsUri);
    writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
            AddressingVersion.W3C.wsdlNsUri);
    //write wsdliLication as defined in WS-Addressing 1.0 Metadata spec
    if(wsdlAddress != null) {
        writeWsdliLocation(writer, service, wsdlAddress, wsdlTargetNamespace);
    }

    //Write Interface info
    if (portType != null) {
        writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                AddressingVersion.W3C.eprType.portTypeName,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
            W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
        String portTypePrefix = portType.getPrefix();
        if (portTypePrefix == null || portTypePrefix.equals("")) {
            //TODO check prefix again
            portTypePrefix = "wsns";
        }
        writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
        writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
        writer.writeEndElement();
    }
    if (service != null) {
        //Write service and Port info
        if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
            writer.writeStartElement(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                    AddressingVersion.W3C.eprType.serviceName,
                    W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            writer.writeNamespace(W3CAddressingMetadataConstants.WSAM_PREFIX_NAME,
                W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME);
            String servicePrefix = service.getPrefix();
            if (servicePrefix == null || servicePrefix.equals("")) {
                //TODO check prefix again
                servicePrefix = "wsns";
            }
            writer.writeNamespace(servicePrefix, service.getNamespaceURI());
            if (port != null) {
                writer.writeAttribute(AddressingVersion.W3C.eprType.portName, port.getLocalPart());
            }
            writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
            writer.writeEndElement();
        }
    }
    /*
    //Inline the wsdl
    if (wsdlAddress != null) {
        writeWsdl(writer, service, wsdlAddress);
    }
    */
    //Add the extra metadata Elements
    if (metadata != null) {
        for (Element e : metadata) {
            DOMUtil.serializeNode(e, writer);
        }
    }
    writer.writeEndElement();

}
 
Example #30
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private boolean fail(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
    return false;
}