use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class EprExtensionsContributorTest 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 EprExtensionsContributorTest 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 SOAPAction2Test method testSOAPActionWithDispatch_WithUse_true_WithWSA.
// when use is true, so action is effective
public void testSOAPActionWithDispatch_WithUse_true_WithWSA() throws JAXBException {
TestEndpoint2 port = new TestEndpointService2().getTestEndpointPort2();
String address = (String) ((BindingProvider) port).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
Service s = Service.create(new QName("http://client.soapaction_use.server/", "TestEndpointService2"));
s.addPort(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), SOAPBinding.SOAP11HTTP_BINDING, address);
Dispatch<Object> d = s.createDispatch(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), JAXBContext.newInstance(ObjectFactory.class), Service.Mode.PAYLOAD, new AddressingFeature());
((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());
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class SOAPAction2Test method testSOAPActionWithDispatch_WithoutUse_WithWSA.
// when WSA is enabled, use property defaults to true, so action is effective
public void testSOAPActionWithDispatch_WithoutUse_WithWSA() throws JAXBException {
TestEndpoint2 port = new TestEndpointService2().getTestEndpointPort2();
String address = (String) ((BindingProvider) port).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
Service s = Service.create(new QName("http://client.soapaction_use.server/", "TestEndpointService2"));
s.addPort(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), SOAPBinding.SOAP11HTTP_BINDING, address);
Dispatch<Object> d = s.createDispatch(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), JAXBContext.newInstance(ObjectFactory.class), Service.Mode.PAYLOAD, new AddressingFeature());
((BindingProvider) d).getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, action);
JAXBElement<String> r = (JAXBElement<String>) d.invoke(new ObjectFactory().createEchoSOAPAction("dummy"));
assertEquals(action, r.getValue());
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class SOAPAction2Test method testSOAPActionWithDispatch_WithUse_false_WithWSA.
// use is false but WSA is enabled, so action is ineffective
public void testSOAPActionWithDispatch_WithUse_false_WithWSA() throws JAXBException {
TestEndpoint2 port = new TestEndpointService2().getTestEndpointPort2();
String address = (String) ((BindingProvider) port).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
Service s = Service.create(new QName("http://client.soapaction_use.server/", "TestEndpointService2"));
s.addPort(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), SOAPBinding.SOAP11HTTP_BINDING, address);
Dispatch<Object> d = new TestEndpointService2().createDispatch(new QName("http://client.soapaction_use.server/", "TestEndpointPort2"), JAXBContext.newInstance(ObjectFactory.class), Service.Mode.PAYLOAD, new AddressingFeature());
((BindingProvider) d).getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, dummy_action);
((BindingProvider) d).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, false);
JAXBElement<String> r = (JAXBElement<String>) d.invoke(new ObjectFactory().createEchoSOAPAction("dummy"));
assertEquals(action, r.getValue());
}
Aggregations