Hi

On Mon, May 9, 2011 at 4:19 AM, cogitate <[email protected]> wrote:
> hi sergey:
>  thanks for valuable changes - in 2.2.4 i had custom stream writer to
> remove these namespaces by hijacking the output stream.
> with the StaxTransformFeature and at the USER_LOGICAL space adding
> message.put( "soap.env.ns.map" , nsMap); i am able to completely control
> what goes out and into the wire.
>

great

> however, i was wondering if you could add support for regex/pattern matching
> on strings that would really help a situation like the following xml
>
> out xml going from cxf :
> <ns2:WebGet xmlns:ns3="http://schemas.web.com/xml/error/";
> xmlns:ns2="http://schemas.web.com/service";><ns2:Buffer><ns2:Name>ROUTE</ns2:Name></ns2:Buffer></ns2:WebGet>
>
> out xml i need :
> <WebGet><Buffer><Name>ROUTE<Name><Buffer><WebGet>
>
> of course i can get this result by having an entry in my spring config(as
> you illustrated) for both ns2 and ns3 namespaces.
>
> i want to be able to pattern match like : "*schemas.web.com*" or simply drop
> all namespace elements. is there a way to do that?
>
At the moment, it is only possible to configure JSONProvider to drop
all the namespaces which can be helpful when
a non-CXF client is consuming a JSON sequence.

I think that dropping all the namespaces for XML payloads can be
useful but one has to know what namespaces has to be dropped, because
if we have a server which does not understand namespaces then it will
return a response containing no namespaces but for this response data
be read back into JAXB bean, one has to know how to augment the
response with namespaces (ex, using
TransformFeature/inTransformElements).

So if we just have a config parameter instructing this feature to drop
the namespaces then we simply won't be able to read the response back,
unless we know which namespaces have to be added back, thus
configuring the feature to drop two specific namespaces looks
acceptable to me.

For the very same reason, we can't use "*schemas.web.com*" unless we
don't really expect the response back.

Does it make sense ?

thanks, Sergey

>
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/cxf-2-4-0-pattern-match-StaxTransformFeature-tp4381005p4381005.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Reply via email to