use of org.apache.cxf.transport.Conduit in project cxf by apache.
the class ProxyTest method testRMClientConstruction.
@Test
public void testRMClientConstruction() {
Proxy proxy = new Proxy(rme);
Bus bus = control.createMock(Bus.class);
EasyMock.expect(bus.getExtension(WSAddressingFeatureApplier.class)).andReturn(new WSAddressingFeatureApplier() {
@Override
public void initializeProvider(WSAddressingFeature feature, InterceptorProvider provider, Bus bus) {
}
}).anyTimes();
Endpoint endpoint = control.createMock(Endpoint.class);
Conduit conduit = control.createMock(Conduit.class);
org.apache.cxf.ws.addressing.EndpointReferenceType address = control.createMock(org.apache.cxf.ws.addressing.EndpointReferenceType.class);
control.replay();
assertNotNull(proxy.createClient(bus, endpoint, ProtocolVariation.RM10WSA200408, conduit, address));
}
use of org.apache.cxf.transport.Conduit in project cxf by apache.
the class RMManagerTest method testRecoverReliableEndpoint.
@Test
public void testRecoverReliableEndpoint() {
manager = new RMManager();
Endpoint endpoint = control.createMock(Endpoint.class);
Conduit conduit = control.createMock(Conduit.class);
control.replay();
manager.recoverReliableEndpoint(endpoint, conduit);
control.verify();
control.reset();
RMStore store = control.createMock(RMStore.class);
manager.setStore(store);
control.replay();
manager.recoverReliableEndpoint(endpoint, conduit);
control.verify();
}
use of org.apache.cxf.transport.Conduit in project jbossws-cxf by jbossws.
the class SOAPConnectionImpl method call.
@Override
public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPException {
checkClosed();
String address = getAddress(addressObject);
ConduitInitiator ci = getConduitInitiator(address);
// create a new Message and Exchange
EndpointInfo info = new EndpointInfo();
info.setAddress(address);
Message outMessage = new MessageImpl();
Exchange exch = new ExchangeImpl();
outMessage.setExchange(exch);
// JBWS-3945
exch.put("org.apache.cxf.transport.process_fault_on_http_400", true);
// sent SOAPMessage
try {
// TODO verify bus
final Conduit c = ci.getConduit(info, BusFactory.getThreadDefaultBus(false));
if (msgOut.saveRequired()) {
msgOut.saveChanges();
}
Map<String, List<String>> outHeaders = new HashMap<String, List<String>>();
for (Iterator<?> it = msgOut.getMimeHeaders().getAllHeaders(); it.hasNext(); ) {
MimeHeader mimeHeader = (MimeHeader) it.next();
if ("Content-Type".equals(mimeHeader.getName())) {
outMessage.put(Message.CONTENT_TYPE, mimeHeader.getValue());
}
// disable the chunked encoding if requested
if ("Transfer-Encoding".equals(mimeHeader.getName()) && "disabled".equals(mimeHeader.getValue()) && c instanceof HTTPConduit) {
((HTTPConduit) c).getClient().setAllowChunking(false);
continue;
}
List<String> values = outHeaders.get(mimeHeader.getName());
if (values == null) {
values = new ArrayList<String>();
outHeaders.put(mimeHeader.getName(), values);
}
values.add(mimeHeader.getValue());
}
outMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
outMessage.put(Message.PROTOCOL_HEADERS, outHeaders);
c.prepare(outMessage);
OutputStream outs = outMessage.getContent(OutputStream.class);
msgOut.writeTo(outs);
c.setMessageObserver(createMessageObserver(c));
c.close(outMessage);
} catch (Exception ex) {
throw MESSAGES.soapMessageCouldNotBeSent(ex);
}
// read SOAPMessage
return readSoapMessage(exch);
}
Aggregations