Package org.apache.cxf.ws.addressing

Examples of org.apache.cxf.ws.addressing.WSAddressingFeature


        return sb;
    }

    protected void setupUDP(InterceptorProvider p, EndpointInfo ei) {
        //soap UDP requires ws-addressing turned on
        WSAddressingFeature add = new WSAddressingFeature();
        add.setAddressingRequired(true);
        add.initialize(p, bus);
       
        // UDP has a strict size limit on messages (<64K) so we'll try to shrink the
        // message a little by putting the WSA namespace into the
        // the soap:env which allows it to not be written on every header
        // element as well as disable the output stream optimizations (doesn't really
View Full Code Here


        serviceFactory.setServiceClass(GreeterImpl.class);
       
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter,
                                                 new JaxWsServerFactoryBean(serviceFactory));

        endpoint.getFeatures().add(new WSAddressingFeature());
        try {
            String address = "http://localhost:8080/test";
            endpoint.publish(address);
        } catch (IllegalArgumentException ex) {
            assertTrue(ex.getCause() instanceof BusException);
View Full Code Here

        Dispatch<StreamSource> dispatcher = service.createDispatch(fakePortName,
                                                                   StreamSource.class,
                                                                   Service.Mode.PAYLOAD);

        Client client = ((DispatchImpl<StreamSource>)dispatcher).getClient();
        WSAddressingFeature wsAddressingFeature = new WSAddressingFeature();
        wsAddressingFeature.initialize(client, client.getBus());
        dispatcher.getRequestContext().put("org.apache.cxf.ws.addressing.replyto",
                                           "http://localhost:" + CLIENT_PORT
                                               + "/SoapContext/AsyncEchoClient");

        StreamSource request = new StreamSource(new ByteArrayInputStream(requestString.getBytes()));
View Full Code Here

        ByteArrayOutputStream output = setupOutLogging();

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(AddNumbersPortType.class);
        factory.setAddress("http://localhost:" + PORT + "/jaxws/add");
        factory.getFeatures().add(new WSAddressingFeature());
        AddNumbersPortType port = (AddNumbersPortType) factory.create();
        ((BindingProvider)port).getRequestContext().put("ws-addressing.write.optional.replyto", Boolean.TRUE);
        assertEquals(3, port.addNumbers(1, 2));
       
        assertLogContains(output.toString(), "//wsa:Address", "http://www.w3.org/2005/08/addressing/anonymous");
View Full Code Here

            }
        }

       
        if (hasUsingAddressing(bindingExtensors) || hasUsingAddressing(portExtensors)) {
            WSAddressingFeature feature = new WSAddressingFeature();
            if (addressingRequired(bindingExtensors)
                || addressingRequired(portExtensors)) {
                feature.setAddressingRequired(true);
            }
            addAddressingFeature(feature);
        }
        extractWsdlEprs(endpoint);
    }
View Full Code Here

        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[] {});
                    Object responses = responsesMethod.invoke(addressing, new Object[] {});
                    feature.setResponses(responses.toString());
                } catch (Exception e) {
                    // ignore
                }
            }
        } else {
View Full Code Here

        List<ExtensibilityElement> bindingExtensors
            = endpoint.getBinding().getExtensors(ExtensibilityElement.class);
        List<ExtensibilityElement> portExtensors
            = endpoint.getExtensors(ExtensibilityElement.class);
        if (hasUsingAddressing(bindingExtensors) || hasUsingAddressing(portExtensors)) {
            WSAddressingFeature feature = new WSAddressingFeature();
            if (addressingRequired(bindingExtensors)
                || addressingRequired(portExtensors)) {
                feature.setAddressingRequired(true);
            }
            addAddressingFeature(feature);
        }
    }
View Full Code Here

        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

        Object implementor = new AddNumberImpl();
        String address = "http://localhost:" + PORT + "/jaxws/add";
        //Endpoint.publish(address, implementor);

        ep = (EndpointImpl) Endpoint.create(implementor);
        ep.getFeatures().add(new WSAddressingFeature());
        ep.publish(address);
       
       
        ep = new EndpointImpl(BusFactory.getThreadDefaultBus(),
                                           implementor,
                                           null,
                                           getWsdl());
        ep.setServiceName(new QName("http://apache.org/cxf/systest/ws/addr_feature/", "AddNumbersService"));
        ep.setEndpointName(new QName("http://apache.org/cxf/systest/ws/addr_feature/",
                                     "AddNumbersNonAnonPort"));
        String address12 = "http://localhost:" + PORT2 + "/jaxws/soap12/add";      
        ep.getFeatures().add(new WSAddressingFeature());
        ep.publish(address12);
       
       
    }
View Full Code Here

            }
        }

       
        if (hasUsingAddressing(bindingExtensors) || hasUsingAddressing(portExtensors)) {
            WSAddressingFeature feature = new WSAddressingFeature();
            if (addressingRequired(bindingExtensors)
                || addressingRequired(portExtensors)) {
                feature.setAddressingRequired(true);
            }
            addAddressingFeature(feature);
        }
        extractWsdlEprs(endpoint);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.addressing.WSAddressingFeature

Copyright © 2018 www.massapicom. 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.