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);
}
Aggregations