use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class OnewayTest method getHttpStatus.
private int getHttpStatus(String address) throws Exception {
QName portName = new QName(NS, "OnewayEndpointPort");
QName serviceName = new QName(NS, "OnewayEndpointService");
Service service = Service.create(new URL(address + "?wsdl"), serviceName);
Dispatch<Source> d = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
String body = "<ns0:echoInteger xmlns:ns0='" + NS + "'><arg0>12345</arg0></ns0:echoInteger>";
d.invokeOneWay(new StreamSource(new StringReader(body)));
Map<String, Object> rc = ((BindingProvider) d).getResponseContext();
return (Integer) rc.get(MessageContext.HTTP_RESPONSE_CODE);
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ClientEprTest method testEprWithDispatchWithWSDL.
public void testEprWithDispatchWithWSDL() throws Exception {
Service service = new HelloService();
Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
w3cEprGettertest(dispatch, true);
msEprGettertest(dispatch, true);
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class WSDLEprExtensionsTest method testEprWithDispatchWithoutWSDL.
/**
* Tests client-side access to EPR extensions specified in WSDL
* @throws Exception
*/
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);
WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
assertTrue(wsepr.getEPRExtensions().isEmpty());
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class WSDLEprExtensionsTest 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://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity"));
assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity")));
}
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() == 2);
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")));
}
Aggregations