Search in sources :

Example 66 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.

the class CXFServiceRefStubPropertyConfigurer method setWSFeature.

private void setWSFeature(JaxWsServiceFactoryBean serviceFactoryBean, UnifiedPortComponentRefMetaData upcmd) {
    List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    List<WebServiceFeature> prevFeatures = serviceFactoryBean.getWsFeatures();
    if (prevFeatures != null) {
        features.addAll(prevFeatures);
    }
    if (upcmd.isMtomEnabled()) {
        if (upcmd.getMtomThreshold() > 0) {
            features.add(new MTOMFeature(true, upcmd.getMtomThreshold()));
        } else {
            features.add(new MTOMFeature(true));
        }
    }
    if (upcmd.isAddressingEnabled()) {
        final String refResponses = upcmd.getAddressingResponses();
        AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
        if ("ANONYMOUS".equals(refResponses))
            responses = AddressingFeature.Responses.ANONYMOUS;
        if ("NON_ANONYMOUS".equals(refResponses))
            responses = AddressingFeature.Responses.NON_ANONYMOUS;
        features.add(new AddressingFeature(true, upcmd.isAddressingRequired(), responses));
    }
    serviceFactoryBean.setWsFeatures(features);
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) MTOMFeature(javax.xml.ws.soap.MTOMFeature) WebServiceFeature(javax.xml.ws.WebServiceFeature) LinkedList(java.util.LinkedList)

Example 67 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.

the class AddressingStatefulTestCase method testItemLifecycle.

@Test
@RunAsClient
public void testItemLifecycle() throws Exception {
    URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
    QName serviceName = new QName("http://org.jboss.ws/samples/wsaddressing", "TestService");
    Service service1 = Service.create(wsdlURL, serviceName);
    AddressingPort port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
    Service service2 = Service.create(wsdlURL, serviceName);
    AddressingPort port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
    port1.addItem("Ice Cream");
    port1.addItem("Ferrari");
    port2.addItem("Mars Bar");
    port2.addItem("Porsche");
    String items1 = port1.getItems();
    assertEquals("[Ice Cream, Ferrari]", items1);
    String items2 = port2.getItems();
    assertEquals("[Mars Bar, Porsche]", items2);
    port1.checkout();
    assertEquals("[]", port1.getItems());
    port2.checkout();
    assertEquals("[]", port2.getItems());
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Aggregations

AddressingFeature (javax.xml.ws.soap.AddressingFeature)67 BindingProvider (javax.xml.ws.BindingProvider)35 URL (java.net.URL)18 QName (javax.xml.namespace.QName)13 Test (org.junit.Test)13 Service (javax.xml.ws.Service)8 ArrayList (java.util.ArrayList)7 WebServiceFeature (javax.xml.ws.WebServiceFeature)7 MTOMFeature (javax.xml.ws.soap.MTOMFeature)7 MAP (org.jboss.ws.api.addressing.MAP)5 RespectBindingFeature (javax.xml.ws.RespectBindingFeature)4 LinkedList (java.util.LinkedList)3 DispatchImpl (org.apache.cxf.jaxws.DispatchImpl)3 WSAddressingFeature (org.apache.cxf.ws.addressing.WSAddressingFeature)3 SoapFaultPortType (org.jboss.jbossts.xts.soapfault.SoapFaultPortType)3 CoordinationContextHandler (com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler)2 Sc007Service (com.jboss.transaction.wstf.webservices.sc007.generated.Sc007Service)2 WSBinding (com.sun.xml.ws.api.WSBinding)2 ServletAdapterList (com.sun.xml.ws.transport.http.servlet.ServletAdapterList)2 Closeable (java.io.Closeable)2