Examples of SubmissionAddressingFeature


Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

     */
    public void configure(MessageContext messageContext, BindingProvider provider) {
        Binding bnd = (Binding) provider.getBinding();
        AddressingFeature addressingFeature =
            (AddressingFeature) bnd.getFeature(AddressingFeature.ID);
        SubmissionAddressingFeature submissionAddressingFeature =
            (SubmissionAddressingFeature) bnd.getFeature(SubmissionAddressingFeature.ID);
        String addressingNamespace = bnd.getAddressingNamespace();
        Boolean disableAddressing =
            (Boolean) messageContext.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        String addressingRequired = AddressingConstants.ADDRESSING_UNSPECIFIED;
       
        //Figure out which WS-Addressing feature was specified causing this configurator to run.
        if (addressingFeature != null && submissionAddressingFeature != null) {
            //Both features must have been specified.
            boolean w3cAddressingEnabled = addressingFeature.isEnabled();
            boolean submissionAddressingEnabled = submissionAddressingFeature.isEnabled();
           
            if (w3cAddressingEnabled && submissionAddressingEnabled) {
                //Use the addressing namespace of the EPR specified
                //via the JAX-WS 2.1 API. If no EPR was specified
                //then the 2005/08 namespace will be used.
                if (addressingNamespace == null)
                    addressingNamespace = Final.WSA_NAMESPACE;
               
                disableAddressing = Boolean.FALSE;
                if (addressingFeature.isRequired() || submissionAddressingFeature.isRequired()) {
                    addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
                }
            }
            else if (w3cAddressingEnabled) {
                //Enable only 2005/08 addressing
                if (Submission.WSA_NAMESPACE.equals(addressingNamespace)) {
                    throw ExceptionFactory.makeWebServiceException(
                              Messages.getMessage("FeatureNamespaceNotSupported",
                                                  addressingNamespace));
                }
                addressingNamespace = Final.WSA_NAMESPACE;
                disableAddressing = Boolean.FALSE;
                if (addressingFeature.isRequired()) {
                    addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
                }
            }
            else if (submissionAddressingEnabled) {
                //Enable only 2004/08 addressing
                if (Final.WSA_NAMESPACE.equals(addressingNamespace)) {
                    throw ExceptionFactory.makeWebServiceException(
                        Messages.getMessage("FeatureNamespaceNotSupported",
                                           addressingNamespace));
                }
                addressingNamespace = Submission.WSA_NAMESPACE;
                disableAddressing = Boolean.FALSE;
                if (submissionAddressingFeature.isRequired()) {
                    addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
                }
            }
            else {
                //Disable 2005/08 and 2004/08 addressing
                disableAddressing = Boolean.TRUE;
            }               
        }
        else if (addressingFeature != null) {
            //The AddressingFeature must have been specified.
            boolean w3cAddressingEnabled = addressingFeature.isEnabled();

            if (w3cAddressingEnabled) {
                //Enable 2005/08 addressing
                if (Submission.WSA_NAMESPACE.equals(addressingNamespace)) {
                    throw ExceptionFactory.makeWebServiceException(
                                Messages.getMessage("FeatureNamespaceNotSupported",
                                                    addressingNamespace));
                }
                addressingNamespace = Final.WSA_NAMESPACE;
                disableAddressing = Boolean.FALSE;
                if (addressingFeature.isRequired()) {
                    addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
                }
            }
            else {
                //Disable 2005/08 addressing
                disableAddressing = Boolean.TRUE;
            }               
        }
        else if (submissionAddressingFeature != null) {
            //The SubmissionAddressingFeature must have been specified.
            boolean submissionAddressingEnabled = submissionAddressingFeature.isEnabled();
           
            if (submissionAddressingEnabled) {
                //Enable 2004/08 addressing
                if (Final.WSA_NAMESPACE.equals(addressingNamespace)) {
                    throw ExceptionFactory.makeWebServiceException(
                              Messages.getMessage("FeatureNamespaceNotSupported",
                                                  addressingNamespace));
                }
                addressingNamespace = Submission.WSA_NAMESPACE;
                disableAddressing = Boolean.FALSE;
                if (submissionAddressingFeature.isRequired()) {
                    addressingRequired = AddressingConstants.ADDRESSING_REQUIRED;
                }
            }
            else {
                //Disable 2004/08 addressing
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test the default configuration of the SubmissionAddressingFeature.
     */
    public void testDefaultSubmissionAddressingFeature() throws Exception {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
        Dispatch<Source> d = svc.createDispatch(subEPR, Source.class, Service.Mode.PAYLOAD, feature);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test disabling the SubmissionAddressing feature.
     */
    public void testDisabledSubmissionAddressingFeature() {
        // Set the feature to be disabled.
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature(false);
               
        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");       
        Dispatch<Source> d = svc.createDispatch(subEPR, Source.class, Service.Mode.PAYLOAD, feature);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    }
   
    // Test configurations that are not allowed with the SubmissionAddressingFeature
    public void testInvalidSubmissionAddressingFeature() {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
        Dispatch<Source> d = svc.createDispatch(w3cEPR, Source.class, Service.Mode.PAYLOAD, feature);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test the default configuration of the SubmissionAddressingFeature.
     */
    public void testDefaultSubmissionAddressingFeature() throws Exception {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(subEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test disabling the SubmissionAddressing feature.
     */
    public void testDisabledSubmissionAddressingFeature() {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature(false);
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(subEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test the default configuration of the SubmissionAddressingFeature.
     */
    public void testInvalidSubmissionAddressingFeature() {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(w3cEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test the default configuration of the SubmissionAddressingFeature.
     */
    public void testDefaultSubmissionAddressingFeature() throws Exception {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(subEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test disabling the SubmissionAddressing feature.
     */
    public void testDisabledSubmissionAddressingFeature() {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature(false);
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(subEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here

Examples of org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature

    /*
     * Test the default configuration of the SubmissionAddressingFeature.
     */
    public void testInvalidSubmissionAddressingFeature() {
        // Use the default feature config
        SubmissionAddressingFeature feature = new SubmissionAddressingFeature();
       
        Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
        ProxyAddressingService proxy = svc.getPort(w3cEPR, ProxyAddressingService.class, feature);
        assertNotNull(proxy);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.