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());
// MemberSubmissionAddressingFeature msAddressingFeature = new MemberSubmissionAddressingFeature(true);
// WebServiceFeature[] features = new WebServiceFeature[] {msAddressingFeature};
WebServiceFeature[] features = null;
Dispatch<SOAPMessage> dispatch = service.createDispatch(PORT_QNAME, SOAPMessage.class, Service.Mode.MESSAGE, features);
return dispatch;
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ClientEpr method testEprWithDispatchWithoutWSDL.
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);
w3cEprGettertest(dispatch, false);
msEprGettertest(dispatch, false);
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ClientEpr method testEprWithDispatchWithWSDL.
public void testEprWithDispatchWithWSDL() throws Exception {
Service service = Service.create(getClass().getResource("../config/HelloService.wsdl"), serviceName);
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 AddNumbersTest method doDispatchTesting.
private void doDispatchTesting(String contextPath, String request, Service.Mode mode, Class expectedClass) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(contextPath);
Unmarshaller u = jaxbContext.createUnmarshaller();
Object obj = u.unmarshal(new StreamSource(new StringReader(request)));
LOGGER.finest("---Marshaller parsed and wrote back----\n" + reconstructMsg(jaxbContext, obj) + "\n---------\n");
Service service = new AddNumbersImplService();
Dispatch dispatch = service.createDispatch(portQName, jaxbContext, mode);
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, "run:tns:AddNumbersService");
JAXBElement response = (JAXBElement) dispatch.invoke(obj);
assertTrue(expectedClass.equals(response.getDeclaredType()));
LOGGER.finest("---result:" + response.getValue().toString() + "---\n" + reconstructMsg(jaxbContext, response) + "\n---------\n");
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class SOAPAction1Test method testSOAPActionWithDispatch_WithUse_true.
// use is set to true, so action property is effective
public void testSOAPActionWithDispatch_WithUse_true() throws JAXBException {
TestEndpoint1 port = new TestEndpointService1().getTestEndpointPort1();
String address = (String) ((BindingProvider) port).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
Service s = Service.create(new QName("http://client.soapaction_use.server/", "TestEndpointService1"));
s.addPort(new QName("http://client.soapaction_use.server/", "TestEndpointPort1"), SOAPBinding.SOAP11HTTP_BINDING, address);
Dispatch<Object> d = s.createDispatch(new QName("http://client.soapaction_use.server/", "TestEndpointPort1"), JAXBContext.newInstance(ObjectFactory.class), Service.Mode.PAYLOAD);
((BindingProvider) d).getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, action);
((BindingProvider) d).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
JAXBElement<String> r = (JAXBElement<String>) d.invoke(new ObjectFactory().createEchoSOAPAction("dummy"));
assertEquals(action, r.getValue());
}
Aggregations