cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject SOAPConnection bypasses CXF HttpConduit
Date Fri, 24 Sep 2010 12:47:19 GMT
Hi

I'm investigating the possibility of disabling the chunked encoding via the
use of opaque or (CXF) specific properties, set on a SOAPMessage
instance and posted via a SOAPConnection.

The idea is that users which may have to deal with multiple SOAP stacks (ex,
supported by a given provider), will not have to disable the chunked
encoding in a stack specific may.

Example.

SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();
SOAPConnection connection =  factory.createConnection();
SOAPMessage msg = soapMessageFactory.createMessage();
msg.setProperty("transport.predetermine-length-of-possible", true);
// or
msg.setProperty("org.apache.cxf.transport.predetermine-length-of-possible",
true);

connection.call(msg, address);

I thought initially the invocation will flow through the CXF interceptors
and so I'd reset that property on the current Message and HttpConduit will
notice it and will try to disallow the chunked encoding if possible.

But it is a default factory which is created instead and thus the stock
HttpUrlConnection is used directly.

So I thought of providing a custom CXF SOAPConnectionFactory which would
create the SOAPConnections which would override call(), create a new CXF
Message, set on it the properties from SOAPMessage, and pass it on to the
chain.
So I've started prototyping a custom factory with the idea of just
delegating a call and returning a response to/from Dispatch<SOAPMessage>.
But in order to get an instance of   I need to create a JAXWS Service first
and we do not know at the SOAPMessage level the service QName.

So it probably makes sense to continue directly working with
HTTPUrlConnection. Which I'm not sure is the right approach, I'd rather
prefer to delegate to CXF and let it deal with buffering the message and get
the length, etc, as it would probably make the inclusion of such the factory
a more real possibility.

Any ideas ?

cheers, Sergey

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message