You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Martin Renner <m....@exxcellent.de> on 2009/04/27 16:52:00 UTC

Smooth namespace migration

Hi,

I have a web service (Soap 1.1, Document wrapped, JAXB) which uses the namespace
"http://something.old". I would like to migrate this namespace to "http://something.new".

Unfortunately, there are quite some clients out there which use my service. So I cannot just switch
the namespace with a new release of my web service. Instead I would like to have a "smooth" transition.

Some code would detect that a client is sending a document with the old namespace. This code would
rewrite the old namespace to the new namespace before/while the document is being unmarshaled.
Furthermore it would set a thread local flag that namespace translation was used. Another piece of
code in the output chain would evaluate this flag and would rewrite the new namespace to the old
namespace, if the flag is set.

This way, old clients would be able to send documents with the old namespace and they would receive
a response from the server with the old namespace.

Is this possible? Where do I have to start?

I already looked into StaxInInterceptor and StaxOutInterceptor. I think that it would be possible to
put a wrapper around XMLStreamReader and XMLStreamWriter, but this would be rather cumbersome (and
slow?). Is there an elegant solution to this problem?

Regards,
Martin