You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by monitorjbl <mo...@gmail.com> on 2011/01/31 16:32:10 UTC

Ignoring namespaces entirely

I am trying to develop a few basic webservices for use with a a commercial
product. The product produces WSDLs for me, which CXF uses to generate the
Java classes I need to work with. There's one hitch with this though, and
that is that the messages sent TO the server must be unqualified (or the
server will error out) and the messages sent FROM the server are qualified.
I can't get JAXB to handle both cases from one schema; if the messages going
out are unqualified, it expects the response to be unqualified as well. I
can more or less replicate this behaviour with manually modified schemas
that have elementFormDefault="qualified" and "unqualified" versions of every
tag I need to use, but this is pretty inelegant (not to mention time
consuming) and I feel like there's a better way to get around this.
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3364646.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Ignoring namespaces entirely

Posted by Glen Mazza <gm...@talend.com>.
More on interceptors here:  
http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors

HTH,
Glen

On 31.01.2011 12:13, Sergey Beryozkin wrote:
> Hi
>
> On Mon, Jan 31, 2011 at 4:29 PM, Taylor Jones (tayjones)<tayjones@cisco.com
>> wrote:
>> Wow, that's a brand new feature. Could you tell me what part of the
>> interceptor chain this substitution would take place? It seems like it's
>> just shorthand for a custom client interceptor.
>>
>>
> Indeed, a custom interceptor can create a custom XMLStreamWriter and
> XMLStreamReader (extending CXF writer/reader utility implementations) and
> modify the payload. I'm not sure right now where such a custom reader or
> writer would need to be registered in the SOAP chain, probably in the WRITE
> phase (when writing). Then the default CXF JAXB DataBinding will use the
> custom writer.
>
> As far as this particular feature is concerned, the substitution will occur
> as part of the SOAP (in/out) interceptors calling on the (custom)
> DataBinding, probably at the write stage
>
> Cheers, Sergey
>
>
>> -----Original Message-----
>> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
>> Sent: Monday, January 31, 2011 10:56 AM
>> To: users@cxf.apache.org
>> Subject: Re: Ignoring namespaces entirely
>>
>> Hi
>>
>> The following suggestion may not  work for you, but if it's a simple
>> soap
>> service and no wrapping/unwrapping is happening, then you might want to
>> experiment with registering a JAXRS DataBinding (for the CXF JAX-WS
>> Client)
>> :
>> http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
>> JAXRSDataBinding
>>
>> and then configure a jaxrs provider to drop the namespaces on the output
>> and
>> add them on the input :
>> http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
>> CustomizingJAXBXMLandJSONinputandoutput,
>> ex
>>
>>
>> No problems if you decide to ignore this particular idea - it's
>> definitely a
>> non-standard approach :-)
>>
>> Cheers, Sergey
>>
>> On Mon, Jan 31, 2011 at 3:32 PM, monitorjbl<mo...@gmail.com>
>> wrote:
>>
>>> I am trying to develop a few basic webservices for use with a a
>> commercial
>>> product. The product produces WSDLs for me, which CXF uses to generate
>> the
>>> Java classes I need to work with. There's one hitch with this though,
>> and
>>> that is that the messages sent TO the server must be unqualified (or
>> the
>>> server will error out) and the messages sent FROM the server are
>> qualified.
>>> I can't get JAXB to handle both cases from one schema; if the messages
>>> going
>>> out are unqualified, it expects the response to be unqualified as
>> well. I
>>> can more or less replicate this behaviour with manually modified
>> schemas
>>> that have elementFormDefault="qualified" and "unqualified" versions of
>>> every
>>> tag I need to use, but this is pretty inelegant (not to mention time
>>> consuming) and I feel like there's a better way to get around this.
>>> --
>>> View this message in context:
>>>
>> http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3
>> 364646.html<http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3%0A364646.html>
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>


-- 
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza



Re: Ignoring namespaces entirely

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Mon, Jan 31, 2011 at 4:29 PM, Taylor Jones (tayjones) <tayjones@cisco.com
> wrote:

> Wow, that's a brand new feature. Could you tell me what part of the
> interceptor chain this substitution would take place? It seems like it's
> just shorthand for a custom client interceptor.
>
>
Indeed, a custom interceptor can create a custom XMLStreamWriter and
XMLStreamReader (extending CXF writer/reader utility implementations) and
modify the payload. I'm not sure right now where such a custom reader or
writer would need to be registered in the SOAP chain, probably in the WRITE
phase (when writing). Then the default CXF JAXB DataBinding will use the
custom writer.

As far as this particular feature is concerned, the substitution will occur
as part of the SOAP (in/out) interceptors calling on the (custom)
DataBinding, probably at the write stage

Cheers, Sergey


> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Monday, January 31, 2011 10:56 AM
> To: users@cxf.apache.org
> Subject: Re: Ignoring namespaces entirely
>
> Hi
>
> The following suggestion may not  work for you, but if it's a simple
> soap
> service and no wrapping/unwrapping is happening, then you might want to
> experiment with registering a JAXRS DataBinding (for the CXF JAX-WS
> Client)
> :
> http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
> JAXRSDataBinding
>
> and then configure a jaxrs provider to drop the namespaces on the output
> and
> add them on the input :
> http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
> CustomizingJAXBXMLandJSONinputandoutput,
> ex
>
>
> No problems if you decide to ignore this particular idea - it's
> definitely a
> non-standard approach :-)
>
> Cheers, Sergey
>
> On Mon, Jan 31, 2011 at 3:32 PM, monitorjbl <mo...@gmail.com>
> wrote:
>
> >
> > I am trying to develop a few basic webservices for use with a a
> commercial
> > product. The product produces WSDLs for me, which CXF uses to generate
> the
> > Java classes I need to work with. There's one hitch with this though,
> and
> > that is that the messages sent TO the server must be unqualified (or
> the
> > server will error out) and the messages sent FROM the server are
> qualified.
> > I can't get JAXB to handle both cases from one schema; if the messages
> > going
> > out are unqualified, it expects the response to be unqualified as
> well. I
> > can more or less replicate this behaviour with manually modified
> schemas
> > that have elementFormDefault="qualified" and "unqualified" versions of
> > every
> > tag I need to use, but this is pretty inelegant (not to mention time
> > consuming) and I feel like there's a better way to get around this.
> > --
> > View this message in context:
> >
> http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3
> 364646.html<http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3%0A364646.html>
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>

RE: Ignoring namespaces entirely

Posted by "Taylor Jones (tayjones)" <ta...@cisco.com>.
Wow, that's a brand new feature. Could you tell me what part of the
interceptor chain this substitution would take place? It seems like it's
just shorthand for a custom client interceptor.

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: Monday, January 31, 2011 10:56 AM
To: users@cxf.apache.org
Subject: Re: Ignoring namespaces entirely

Hi

The following suggestion may not  work for you, but if it's a simple
soap
service and no wrapping/unwrapping is happening, then you might want to
experiment with registering a JAXRS DataBinding (for the CXF JAX-WS
Client)
:
http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
JAXRSDataBinding

and then configure a jaxrs provider to drop the namespaces on the output
and
add them on the input :
http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-
CustomizingJAXBXMLandJSONinputandoutput,
ex


No problems if you decide to ignore this particular idea - it's
definitely a
non-standard approach :-)

Cheers, Sergey

On Mon, Jan 31, 2011 at 3:32 PM, monitorjbl <mo...@gmail.com>
wrote:

>
> I am trying to develop a few basic webservices for use with a a
commercial
> product. The product produces WSDLs for me, which CXF uses to generate
the
> Java classes I need to work with. There's one hitch with this though,
and
> that is that the messages sent TO the server must be unqualified (or
the
> server will error out) and the messages sent FROM the server are
qualified.
> I can't get JAXB to handle both cases from one schema; if the messages
> going
> out are unqualified, it expects the response to be unqualified as
well. I
> can more or less replicate this behaviour with manually modified
schemas
> that have elementFormDefault="qualified" and "unqualified" versions of
> every
> tag I need to use, but this is pretty inelegant (not to mention time
> consuming) and I feel like there's a better way to get around this.
> --
> View this message in context:
>
http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3
364646.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: Ignoring namespaces entirely

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

The following suggestion may not  work for you, but if it's a simple soap
service and no wrapping/unwrapping is happening, then you might want to
experiment with registering a JAXRS DataBinding (for the CXF JAX-WS Client)
:
http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-JAXRSDataBinding

and then configure a jaxrs provider to drop the namespaces on the output and
add them on the input :
http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-CustomizingJAXBXMLandJSONinputandoutput,
ex


No problems if you decide to ignore this particular idea - it's definitely a
non-standard approach :-)

Cheers, Sergey

On Mon, Jan 31, 2011 at 3:32 PM, monitorjbl <mo...@gmail.com> wrote:

>
> I am trying to develop a few basic webservices for use with a a commercial
> product. The product produces WSDLs for me, which CXF uses to generate the
> Java classes I need to work with. There's one hitch with this though, and
> that is that the messages sent TO the server must be unqualified (or the
> server will error out) and the messages sent FROM the server are qualified.
> I can't get JAXB to handle both cases from one schema; if the messages
> going
> out are unqualified, it expects the response to be unqualified as well. I
> can more or less replicate this behaviour with manually modified schemas
> that have elementFormDefault="qualified" and "unqualified" versions of
> every
> tag I need to use, but this is pretty inelegant (not to mention time
> consuming) and I feel like there's a better way to get around this.
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Ignoring-namespaces-entirely-tp3364646p3364646.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>