use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class JaxWsEndpointImpl method resolveFeatures.
public final void resolveFeatures() {
AddressingFeature addressing = getAddressingFeature();
if (addressing == null) {
return;
}
if (addressing.isEnabled()) {
WSAddressingFeature feature = getWSAddressingFeature();
if (feature == null) {
feature = new WSAddressingFeature();
addAddressingFeature(feature);
}
feature.setAddressingRequired(addressing.isRequired());
feature.setResponses(addressing.getResponses().toString());
} else {
removeAddressingFeature();
getEndpointInfo().setProperty("org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled", Boolean.TRUE);
}
}
use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class DispatchClientServerTest method testJAXBObjectPAYLOADFromEPR.
@Test
public void testJAXBObjectPAYLOADFromEPR() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(wsdl);
SOAPService service = new SOAPService(wsdl, SERVICE_NAME);
assertNotNull(service);
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder.address("http://localhost:" + greeterPort + "/SOAPDispatchService/SoapDispatchPort");
builder.serviceName(SERVICE_NAME);
builder.endpointName(PORT_NAME);
W3CEndpointReference w3cEpr = builder.build();
JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
Dispatch<Object> disp = service.createDispatch(w3cEpr, jc, Service.Mode.PAYLOAD, new AddressingFeature());
doJAXBPayload(disp);
}
use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class WSSecurityClientTest method createUsernameTokenDispatcher.
private static Dispatch<Source> createUsernameTokenDispatcher(boolean decoupled, String port) {
final Service service = Service.create(GREETER_SERVICE_QNAME);
service.addPort(USERNAME_TOKEN_PORT_QNAME, decoupled ? SOAPBinding.SOAP11HTTP_BINDING : HTTPBinding.HTTP_BINDING, "http://localhost:" + port + "/GreeterService/UsernameTokenPort");
final Dispatch<Source> dispatcher = service.createDispatch(USERNAME_TOKEN_PORT_QNAME, Source.class, Service.Mode.MESSAGE, new AddressingFeature(decoupled, decoupled));
final java.util.Map<String, Object> requestContext = dispatcher.getRequestContext();
requestContext.put(MessageContext.HTTP_REQUEST_METHOD, "POST");
if (decoupled) {
HTTPConduit cond = (HTTPConduit) ((DispatchImpl<?>) dispatcher).getClient().getConduit();
cond.getClient().setDecoupledEndpoint("http://localhost:" + DEC_PORT + "/decoupled");
}
return dispatcher;
}
use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class JMSClientServerTest method testOneWayQueueConnection.
@Test
public void testOneWayQueueConnection() throws Exception {
QName serviceName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldOneWayQueueService");
QName portName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldOneWayQueuePort");
URL wsdl = getWSDLURL("/wsdl/jms_test.wsdl");
HelloWorldOneWayQueueService service = new HelloWorldOneWayQueueService(wsdl, serviceName);
HelloWorldOneWayPort greeter = service.getPort(portName, HelloWorldOneWayPort.class, new AddressingFeature(true, true));
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("JMS:Queue:Milestone-" + idx);
}
// Give some time to complete one-way calls.
Thread.sleep(100L);
((java.io.Closeable) greeter).close();
}
use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class WSADisableTest method testDiaptchWithWsaDisable.
@Test
public void testDiaptchWithWsaDisable() throws Exception {
QName port = new QName("http://apache.org/cxf/systest/ws/addr_feature/", "AddNumbersPort");
Dispatch<SOAPMessage> disptch = getService().createDispatch(port, SOAPMessage.class, javax.xml.ws.Service.Mode.MESSAGE, new AddressingFeature(false));
((BindingProvider) disptch).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/add");
InputStream is = getClass().getResourceAsStream("resources/AddNumbersDispatchReq.xml");
SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
assertNotNull(soapReqMsg);
try {
disptch.invoke(soapReqMsg);
fail("The MAPcodec ate the SOAPFaultException");
} catch (javax.xml.ws.soap.SOAPFaultException e) {
// expected
}
}
Aggregations