Search in sources :

Example 71 with Service

use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.

the class ClientEprTest method testEprWithDispatchWithoutWSDL.

public void testEprWithDispatchWithoutWSDL() throws Exception {
    Service service = Service.create(serviceName);
    service.addPort(portName, jakarta.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    w3cEprGettertest(dispatch, false);
    msEprGettertest(dispatch, false);
}
Also used : Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Example 72 with Service

use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.

the class EprExtensionsContributorTest method testEprWithDispatchWithWSDL.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 *
 * @throws Exception
 */
public void testEprWithDispatchWithWSDL() throws Exception {
    Service service = new HelloService();
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Example 73 with Service

use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.

the class ServiceTest method test.

public void test() throws Exception {
    Service service = Service.create(new QName("", ""));
    Iterator<QName> ports = service.getPorts();
    assertFalse(ports.hasNext());
    QName newPort = new QName("urn:test", "newPort");
    service.addPort(newPort, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost/service");
    ports = service.getPorts();
    assertEquals(newPort, ports.next());
}
Also used : QName(javax.xml.namespace.QName) Service(jakarta.xml.ws.Service)

Example 74 with Service

use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.

the class DispatchClient method createDispatchSource.

Dispatch<Source> createDispatchSource() {
    QName serviceName = new QName("test", "test");
    QName portName = new QName("test", "test");
    Service s = Service.create(serviceName);
    s.addPort(portName, HTTPBinding.HTTP_BINDING, endpointAddress);
    Dispatch<Source> d = s.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    setHandlerChain(d);
    return d;
}
Also used : QName(javax.xml.namespace.QName) Service(jakarta.xml.ws.Service) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) DataSource(jakarta.activation.DataSource)

Example 75 with Service

use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.

the class DispatchClient method createDispatchDataSource.

Dispatch<DataSource> createDispatchDataSource() {
    QName serviceName = new QName("test", "test");
    QName portName = new QName("test", "test");
    Service s = Service.create(serviceName);
    s.addPort(portName, HTTPBinding.HTTP_BINDING, endpointAddress);
    Dispatch<DataSource> d = s.createDispatch(portName, DataSource.class, Service.Mode.MESSAGE);
    setHandlerChain(d);
    return d;
}
Also used : QName(javax.xml.namespace.QName) Service(jakarta.xml.ws.Service) DataSource(jakarta.activation.DataSource)

Aggregations

Service (jakarta.xml.ws.Service)81 QName (javax.xml.namespace.QName)45 Source (javax.xml.transform.Source)23 StreamSource (javax.xml.transform.stream.StreamSource)21 BindingProvider (jakarta.xml.ws.BindingProvider)17 Dispatch (jakarta.xml.ws.Dispatch)16 URL (java.net.URL)13 StringReader (java.io.StringReader)11 WebService (jakarta.jws.WebService)10 DataSource (jakarta.activation.DataSource)8 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)7 JAXBElement (jakarta.xml.bind.JAXBElement)7 Handler (jakarta.xml.ws.handler.Handler)7 WSBindingProvider (com.sun.xml.ws.developer.WSBindingProvider)6 SOAPMessage (jakarta.xml.soap.SOAPMessage)6 ByteArrayInputStream (java.io.ByteArrayInputStream)6 JAXBContext (jakarta.xml.bind.JAXBContext)5 Binding (jakarta.xml.ws.Binding)5 AddressingFeature (jakarta.xml.ws.soap.AddressingFeature)5 SOAPBinding (jakarta.xml.ws.soap.SOAPBinding)5