Search in sources :

Example 36 with AddressingFeature

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

the class JBWS3773TestCase method initPort.

private Greeter initPort() throws Exception {
    URL wsdlURL = new URL(baseURL + "/SOAPService?wsdl");
    QName qname = new QName("http://jboss.org/hello_world", "SOAPService");
    Service service = Service.create(wsdlURL, qname);
    Greeter greeter = service.getPort(Greeter.class, new AddressingFeature());
    return greeter;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL)

Example 37 with AddressingFeature

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

the class EndpointReferenceTestCase method testDispatchWithFeatures.

@Test
@RunAsClient
public void testDispatchWithFeatures() throws Exception {
    final Dispatch<Source> dispatch = service.createDispatch(PORT_QNAME, Source.class, Mode.PAYLOAD, new AddressingFeature(false, false));
    this.validateEndpointReferences(dispatch);
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) Source(javax.xml.transform.Source) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 38 with AddressingFeature

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

the class CXFServiceObjectFactoryJAXWS method getFeatures.

private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData portComponentRefMD) {
    List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    // configure @Addressing feature
    if (portComponentRefMD.isAddressingAnnotationSpecified()) {
        final boolean enabled = portComponentRefMD.isAddressingEnabled();
        final boolean required = portComponentRefMD.isAddressingRequired();
        final String refResponses = portComponentRefMD.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(enabled, required, responses));
    }
    // configure @MTOM feature
    if (portComponentRefMD.isMtomEnabled()) {
        features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
    }
    // configure @RespectBinding feature
    if (portComponentRefMD.isRespectBindingAnnotationSpecified()) {
        final boolean enabled = portComponentRefMD.isRespectBindingEnabled();
        features.add(new RespectBindingFeature(enabled));
    }
    return features.size() == 0 ? null : features.toArray(new WebServiceFeature[] {});
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) MTOMFeature(javax.xml.ws.soap.MTOMFeature) RespectBindingFeature(javax.xml.ws.RespectBindingFeature) WebServiceFeature(javax.xml.ws.WebServiceFeature) LinkedList(java.util.LinkedList)

Example 39 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project tomee by apache.

the class WebServiceInjectionTest method checkConfiguration.

@Test
public void checkConfiguration() {
    // assertEquals("ok", api.test()); // local call so skip it but check config which is actually the only interesting thing
    final Client client = ClientProxy.getClient(api);
    testPort(client);
    testPort(ClientProxy.getClient(service.getMyWsApi()));
    testPortWithFeature(ClientProxy.getClient(service.getMyWsApi(new AddressingFeature())));
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) WebServiceClient(javax.xml.ws.WebServiceClient) Client(org.apache.cxf.endpoint.Client) Test(org.junit.Test)

Example 40 with AddressingFeature

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

the class SymmetricBindingTest method testUsernameTokenSAML2Dispatch.

@org.junit.Test
public void testUsernameTokenSAML2Dispatch() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = SymmetricBindingTest.class.getResource("cxf-client.xml");
    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    URL wsdl = SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
    Service service = Service.create(wsdl, SERVICE_QNAME);
    QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML2Port");
    Dispatch<DOMSource> dispatch = service.createDispatch(portQName, DOMSource.class, Service.Mode.PAYLOAD, new AddressingFeature());
    updateAddressPort(dispatch, test.getPort());
    // Setup STSClient
    STSClient stsClient = createDispatchSTSClient(bus);
    String wsdlLocation = "http://localhost:" + test.getStsPort() + "/SecurityTokenService/UT?wsdl";
    stsClient.setWsdlLocation(wsdlLocation);
    // Creating a DOMSource Object for the request
    DOMSource request = createDOMRequest();
    // Make a successful request
    Client client = ((DispatchImpl<DOMSource>) dispatch).getClient();
    client.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
    if (test.isStreaming()) {
        client.getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
        client.getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
    }
    DOMSource response = dispatch.invoke(request);
    assertNotNull(response);
    bus.shutdown(true);
}
Also used : Bus(org.apache.cxf.Bus) DOMSource(javax.xml.transform.dom.DOMSource) STSClient(org.apache.cxf.ws.security.trust.STSClient) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) AddressingFeature(javax.xml.ws.soap.AddressingFeature) QName(javax.xml.namespace.QName) DispatchImpl(org.apache.cxf.jaxws.DispatchImpl) Service(javax.xml.ws.Service) STSClient(org.apache.cxf.ws.security.trust.STSClient) Client(org.apache.cxf.endpoint.Client) URL(java.net.URL)

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 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 InputStream (java.io.InputStream)2