Search in sources :

Example 81 with Service

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

the class HttpContextTest method invoke.

private void invoke(String address) {
    // access service
    QName portName = new QName("http://echo.org/", "RpcLitPort");
    QName serviceName = new QName("http://echo.org/", "RpcLitEndpoint");
    Service service = Service.create(serviceName);
    service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
    Dispatch<Source> d = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    String body = "<ns0:echoInteger xmlns:ns0=\"http://echo.abstract.org/\"><arg0>2</arg0></ns0:echoInteger>";
    Source request = new StreamSource(new ByteArrayInputStream(body.getBytes()));
    d.invoke(request);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) Service(jakarta.xml.ws.Service) ExecutorService(java.util.concurrent.ExecutorService) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source)

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