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