Search in sources :

Example 61 with Service

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

the class AddNumbersClient method testAddressingWithNoWSDL.

public void testAddressingWithNoWSDL() throws Exception {
    Service service = Service.create(SERVICE_QNAME);
    service.addPort(PORT_QNAME, SOAPBinding.SOAP11HTTP_BINDING, getAddress());
    Dispatch<SOAPMessage> dispatch = service.createDispatch(PORT_QNAME, SOAPMessage.class, Service.Mode.MESSAGE, new AddressingFeature());
    dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
    dispatch.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, ADD_NUMBERS_ACTION);
    String message = "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>" + "<addNumbers xmlns=\"http://example.com/\">" + "<number1>10</number1>" + "<number2>10</number2>" + "</addNumbers>" + "</S:Body></S:Envelope>";
    WsaUtils.invoke(dispatch, message);
}
Also used : AddressingFeature(jakarta.xml.ws.soap.AddressingFeature) Service(jakarta.xml.ws.Service) SOAPMessage(jakarta.xml.soap.SOAPMessage)

Example 62 with Service

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

the class AddNumbersClient method createDispatchWithoutWSDL.

private Dispatch<SOAPMessage> createDispatchWithoutWSDL() throws Exception {
    Service service = Service.create(SERVICE_QNAME);
    service.addPort(PORT_QNAME, SOAPBinding.SOAP11HTTP_BINDING, getAddress());
    return service.createDispatch(PORT_QNAME, SOAPMessage.class, Service.Mode.MESSAGE, DISABLED_ADDRESSING_FEATURE);
}
Also used : Service(jakarta.xml.ws.Service)

Example 63 with Service

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

the class SEITest method testHello1.

public void testHello1() throws Exception {
    ;
    Service service = new Hello_Service();
    MyHello proxy = service.getPort(MyHello.class);
    testProxy(proxy);
}
Also used : Service(jakarta.xml.ws.Service)

Example 64 with Service

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

the class SEITest method testHello.

public void testHello() throws Exception {
    URL wsdl = new Hello_Service().getWSDLDocumentLocation();
    QName sname = new QName("urn:test", "Hello");
    QName pname = new QName("urn:test", "HelloPort");
    Service service = Service.create(wsdl, sname);
    MyHello proxy = service.getPort(pname, MyHello.class);
    testProxy(proxy);
}
Also used : QName(javax.xml.namespace.QName) Service(jakarta.xml.ws.Service) URL(java.net.URL)

Example 65 with Service

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

the class PutTest method testPut.

public void testPut() {
    BindingProvider bp = (BindingProvider) (new Hello_Service().getHelloPort());
    String address = (String) bp.getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    // Use the above address for a new client
    QName serviceName = new QName("");
    QName portName = new QName("");
    Service service = Service.create(serviceName);
    service.addPort(portName, HTTPBinding.HTTP_BINDING, address);
    Dispatch<DataSource> d = service.createDispatch(portName, DataSource.class, Service.Mode.MESSAGE);
    setupHTTPHeaders(d);
    d.invoke(getDataSource());
    Map<String, Object> rc = d.getResponseContext();
    assertEquals(200, rc.get(MessageContext.HTTP_RESPONSE_CODE));
}
Also used : QName(javax.xml.namespace.QName) Service(jakarta.xml.ws.Service) BindingProvider(jakarta.xml.ws.BindingProvider) 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