Examples of AddressingFeature


Examples of javax.xml.ws.soap.AddressingFeature

        URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
        assertNotNull("WSDL is null", wsdl);
        QName serviceName = new QName("http://apache.org/cxf/systest/ws/addr_feature/", "AddNumbersService");
        AddNumbersService service = new AddNumbersService(wsdl, serviceName);
        assertNotNull("Service is null ", service);
        AddNumbersPortType port = service.getAddNumbersPort(new AddressingFeature());
        //updateAddressPort(port, PORT);
        return port;
    }
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        }
        return null;
    }
   
    public final void resolveFeatures() {
        AddressingFeature addressing = getAddressingFeature();
        if (addressing == null) {
            return;
        }
        if (addressing.isEnabled()) {
            WSAddressingFeature feature = getWSAddressingFeature();
            if (feature == null) {
                feature = new WSAddressingFeature();
                addAddressingFeature(feature);
            }
            feature.setAddressingRequired(addressing.isRequired());
            if (ProviderImpl.isJaxWs22()) {
                try {
                    Class<?> addrClass = ClassLoaderUtils.loadClass("javax.xml.ws.soap.AddressingFeature",
                                                                    ProviderImpl.class);
                    Method responsesMethod = addrClass.getMethod("getResponses", new Class[] {});
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

                        });
                    Object obj = constructor.newInstance(addressing.enabled(), addressing.required(),
                                                         responses);
                    features.add((WebServiceFeature)obj);
                } catch (Exception e) {
                    features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
                }
            } else {
                features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
            }

        }

        if (features.size() > 0) {
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        if (addressing == null && serviceClass != null) {
            addressing = serviceClass.getAnnotation(Addressing.class);
        }

        if (addressing != null) {
            features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
        }

        if (features.size() > 0) {
            wsFeatures = features;
            if (setWsFeatures != null) {
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        }
        return null;
    }
   
    public final void resolveFeatures() {
        AddressingFeature addressing = getAddressingFeature();
        if (addressing == null) {
            return;
        }
        if (addressing.isEnabled()) {
            WSAddressingFeature feature = getWSAddressingFeature();
            if (feature == null) {
                feature = new WSAddressingFeature();
                addAddressingFeature(feature);
            }
            feature.setAddressingRequired(addressing.isRequired());
        } else {
            removeAddressingFeature();
            getEndpointInfo().setProperty("org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled",
                                          Boolean.TRUE);
        }
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        );
        final Dispatch<Source> dispatcher = service.createDispatch(
            USERNAME_TOKEN_PORT_QNAME,
            Source.class,
            Service.Mode.MESSAGE,
            new AddressingFeature(decoupled, decoupled)
        );
        final java.util.Map<String, Object> requestContext =
            dispatcher.getRequestContext();
        requestContext.put(
            MessageContext.HTTP_REQUEST_METHOD,
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

     (non-Javadoc)
     * @see org.apache.axis2.jaxws.feature.ClientConfigurator#configure(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
     */
    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
                disableAddressing = Boolean.TRUE;
            }               
        }
        else {
            //If neither were specified then this configurator should never run.
            throw ExceptionFactory.makeWebServiceException(
                  Messages.getMessage("NoWSAddressingFeatures"));
        }
       
        if (!disableAddressing) {
            try {
                EndpointReference epr = bnd.getAxis2EndpointReference();
                org.apache.axis2.context.MessageContext axis2MessageContext =
                    messageContext.getAxisMessageContext();
                axis2MessageContext.setTo(epr);
               
                ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
                AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
                if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING)) {
                    axisConfig.engageModule(Constants.MODULE_ADDRESSING);
                }
            }
            catch (Exception e) {
                throw ExceptionFactory.
                    makeWebServiceException(
                       Messages.getMessage("AddressingEngagementError", e.toString()));
            }
        }

        messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, addressingNamespace);                       
        messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, disableAddressing);
        messageContext.setProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER, addressingRequired);
       
        // If the Addressing feature was specified, then get the responses value from it and map to the value
        // the addressing handler expects
        if (addressingFeature != null) {
            messageContext.setProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME,
                    org.apache.axis2.jaxws.server.config.AddressingConfigurator.mapResponseAttributeToAddressing(addressingFeature.getResponses()));
        }
    }
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

                        });
                    Object obj = constructor.newInstance(addressing.enabled(), addressing.required(),
                                                         responses);
                    features.add((WebServiceFeature)obj);
                } catch (Exception e) {
                    features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
                }
            } else {
                features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
            }

        }

        RespectBinding respectBinding = implInfo.getImplementorClass().getAnnotation(
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        }
        return null;
    }
   
    public final void resolveFeatures() {
        AddressingFeature addressing = getAddressingFeature();
        if (addressing == null) {
            return;
        }
        if (addressing.isEnabled()) {
            WSAddressingFeature feature = getWSAddressingFeature();
            if (feature == null) {
                feature = new WSAddressingFeature();
                addAddressingFeature(feature);
            }
            feature.setAddressingRequired(addressing.isRequired());
            if (ProviderImpl.isJaxWs22()) {
                try {
                    Class<?> addrClass = ClassLoaderUtils.loadClass("javax.xml.ws.soap.AddressingFeature",
                                                                    ProviderImpl.class);
                    Method responsesMethod = addrClass.getMethod("getResponses", new Class[] {});
View Full Code Here

Examples of javax.xml.ws.soap.AddressingFeature

        );
        final Dispatch<Source> dispatcher = service.createDispatch(
            USERNAME_TOKEN_PORT_QNAME,
            Source.class,
            Service.Mode.MESSAGE,
            new AddressingFeature(decoupled, decoupled)
        );
        final java.util.Map<String, Object> requestContext =
            dispatcher.getRequestContext();
        requestContext.put(
            MessageContext.HTTP_REQUEST_METHOD,
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.