You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Nick Heudecker <nh...@gmail.com> on 2008/11/10 19:11:25 UTC

How does CXF determine the namespaces to output?

I've noticed that when I call my services using CXF, it only outputs the
namespaces necessary for the output objects, which is the behavior I'm
looking for.  If I make the same type of call outside CXF with my own
configured JAXB instance, JAXB dumps out all of the namespaces it knows
about even thought they're not needed.  CXF does the right thing while JAXB
doesn't and I'd like to know how CXF does it.

Any help is appreciated.

-Nick

Re: How does CXF determine the namespaces to output?

Posted by Eric Johnson <er...@progress.com>.
You could use the jaxws:server config bean.

-  
Eric Johnson
Principal Technical Writer
MII-KS, FUSE
Progress Software Corporation


On Mon, 2008-11-10 at 11:01 -0800, Nick Heudecker wrote:
> Thanks for the quick reply.
> 
> No, not annoyed at all.  But that leads me to another unrelated question
> when trying to set my own namespace prefix mapper.  I checked out the docs
> here:
> 
> http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
> 
> That page implies that I can have
> 
> <jaxws:endpoint ...>
>       <jaxws:dataBinding>
>            <!-- ... -->
>       </jaxws:dataBinding>
> </jaxws:endpoint>
> 
> But setting that results in the following error at startup:
> 
> org.springframework.beans.InvalidPropertyException: Invalid property
> 'dataBinding' of bean class
[org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl]:
> No property 'dataBinding' found
> 
> Is it possible to set the dataBinding anyplace else?
> 
> On Mon, Nov 10, 2008 at 10:52 AM, Benson Margulies <bi...@gmail.com>wrote:
> 
> > If I recommended that you read our code in the vicinity of the class
> > JAXBDataBinding, would you be annoyed? It sets up a whole series of
> > JAXB options.
> >
> > On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
> > wrote:
> > > I've noticed that when I call my services using CXF, it only outputs the
> > > namespaces necessary for the output objects, which is the behavior I'm
> > > looking for.  If I make the same type of call outside CXF with my own
> > > configured JAXB instance, JAXB dumps out all of the namespaces it knows
> > > about even thought they're not needed.  CXF does the right thing while
> > JAXB
> > > doesn't and I'd like to know how CXF does it.
> > >
> > > Any help is appreciated.
> > >
> > > -Nick
> > >
> >

Re: How does CXF determine the namespaces to output?

Posted by Benson Margulies <bi...@gmail.com>.
That class is used only in the wsdl2java side of things. There is
another class with the same name in the live runtime.

On Mon, Nov 10, 2008 at 3:22 PM, Nick Heudecker <nh...@gmail.com> wrote:
> I changed my endpoint to server and it works fine now.  Thanks for the quick
> replies.
>
> Regarding my first question, I'm still digging around, but it looks like the
> namespace magic happens in JAXBDataBinding#initialize(ToolContext).
>
> On Mon, Nov 10, 2008 at 12:00 PM, Benson Margulies <bi...@gmail.com>wrote:
>
>> That looks wrong, but I'm not well-positioned to figure it out until
>> this evening. You could try not capitalizing it.
>>
>> Hopefully some one else will chime in.
>>
>>
>> On Mon, Nov 10, 2008 at 2:01 PM, Nick Heudecker <nh...@gmail.com>
>> wrote:
>> > Thanks for the quick reply.
>> >
>> > No, not annoyed at all.  But that leads me to another unrelated question
>> > when trying to set my own namespace prefix mapper.  I checked out the
>> docs
>> > here:
>> >
>> > http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
>> >
>> > That page implies that I can have
>> >
>> > <jaxws:endpoint ...>
>> >      <jaxws:dataBinding>
>> >           <!-- ... -->
>> >      </jaxws:dataBinding>
>> > </jaxws:endpoint>
>> >
>> > But setting that results in the following error at startup:
>> >
>> > org.springframework.beans.InvalidPropertyException: Invalid property
>> > 'dataBinding' of bean class
>> >
>> [org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl]:
>> > No property 'dataBinding' found
>> >
>> > Is it possible to set the dataBinding anyplace else?
>> >
>> > On Mon, Nov 10, 2008 at 10:52 AM, Benson Margulies <
>> bimargulies@gmail.com>wrote:
>> >
>> >> If I recommended that you read our code in the vicinity of the class
>> >> JAXBDataBinding, would you be annoyed? It sets up a whole series of
>> >> JAXB options.
>> >>
>> >> On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
>> >> wrote:
>> >> > I've noticed that when I call my services using CXF, it only outputs
>> the
>> >> > namespaces necessary for the output objects, which is the behavior I'm
>> >> > looking for.  If I make the same type of call outside CXF with my own
>> >> > configured JAXB instance, JAXB dumps out all of the namespaces it
>> knows
>> >> > about even thought they're not needed.  CXF does the right thing while
>> >> JAXB
>> >> > doesn't and I'd like to know how CXF does it.
>> >> >
>> >> > Any help is appreciated.
>> >> >
>> >> > -Nick
>> >> >
>> >>
>> >
>>
>

Re: How does CXF determine the namespaces to output?

Posted by Nick Heudecker <nh...@gmail.com>.
I changed my endpoint to server and it works fine now.  Thanks for the quick
replies.

Regarding my first question, I'm still digging around, but it looks like the
namespace magic happens in JAXBDataBinding#initialize(ToolContext).

On Mon, Nov 10, 2008 at 12:00 PM, Benson Margulies <bi...@gmail.com>wrote:

> That looks wrong, but I'm not well-positioned to figure it out until
> this evening. You could try not capitalizing it.
>
> Hopefully some one else will chime in.
>
>
> On Mon, Nov 10, 2008 at 2:01 PM, Nick Heudecker <nh...@gmail.com>
> wrote:
> > Thanks for the quick reply.
> >
> > No, not annoyed at all.  But that leads me to another unrelated question
> > when trying to set my own namespace prefix mapper.  I checked out the
> docs
> > here:
> >
> > http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
> >
> > That page implies that I can have
> >
> > <jaxws:endpoint ...>
> >      <jaxws:dataBinding>
> >           <!-- ... -->
> >      </jaxws:dataBinding>
> > </jaxws:endpoint>
> >
> > But setting that results in the following error at startup:
> >
> > org.springframework.beans.InvalidPropertyException: Invalid property
> > 'dataBinding' of bean class
> >
> [org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl]:
> > No property 'dataBinding' found
> >
> > Is it possible to set the dataBinding anyplace else?
> >
> > On Mon, Nov 10, 2008 at 10:52 AM, Benson Margulies <
> bimargulies@gmail.com>wrote:
> >
> >> If I recommended that you read our code in the vicinity of the class
> >> JAXBDataBinding, would you be annoyed? It sets up a whole series of
> >> JAXB options.
> >>
> >> On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
> >> wrote:
> >> > I've noticed that when I call my services using CXF, it only outputs
> the
> >> > namespaces necessary for the output objects, which is the behavior I'm
> >> > looking for.  If I make the same type of call outside CXF with my own
> >> > configured JAXB instance, JAXB dumps out all of the namespaces it
> knows
> >> > about even thought they're not needed.  CXF does the right thing while
> >> JAXB
> >> > doesn't and I'd like to know how CXF does it.
> >> >
> >> > Any help is appreciated.
> >> >
> >> > -Nick
> >> >
> >>
> >
>

Re: How does CXF determine the namespaces to output?

Posted by Benson Margulies <bi...@gmail.com>.
That looks wrong, but I'm not well-positioned to figure it out until
this evening. You could try not capitalizing it.

Hopefully some one else will chime in.


On Mon, Nov 10, 2008 at 2:01 PM, Nick Heudecker <nh...@gmail.com> wrote:
> Thanks for the quick reply.
>
> No, not annoyed at all.  But that leads me to another unrelated question
> when trying to set my own namespace prefix mapper.  I checked out the docs
> here:
>
> http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
>
> That page implies that I can have
>
> <jaxws:endpoint ...>
>      <jaxws:dataBinding>
>           <!-- ... -->
>      </jaxws:dataBinding>
> </jaxws:endpoint>
>
> But setting that results in the following error at startup:
>
> org.springframework.beans.InvalidPropertyException: Invalid property
> 'dataBinding' of bean class
> [org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl]:
> No property 'dataBinding' found
>
> Is it possible to set the dataBinding anyplace else?
>
> On Mon, Nov 10, 2008 at 10:52 AM, Benson Margulies <bi...@gmail.com>wrote:
>
>> If I recommended that you read our code in the vicinity of the class
>> JAXBDataBinding, would you be annoyed? It sets up a whole series of
>> JAXB options.
>>
>> On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
>> wrote:
>> > I've noticed that when I call my services using CXF, it only outputs the
>> > namespaces necessary for the output objects, which is the behavior I'm
>> > looking for.  If I make the same type of call outside CXF with my own
>> > configured JAXB instance, JAXB dumps out all of the namespaces it knows
>> > about even thought they're not needed.  CXF does the right thing while
>> JAXB
>> > doesn't and I'd like to know how CXF does it.
>> >
>> > Any help is appreciated.
>> >
>> > -Nick
>> >
>>
>

Re: How does CXF determine the namespaces to output?

Posted by Nick Heudecker <nh...@gmail.com>.
Thanks for the quick reply.

No, not annoyed at all.  But that leads me to another unrelated question
when trying to set my own namespace prefix mapper.  I checked out the docs
here:

http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html

That page implies that I can have

<jaxws:endpoint ...>
      <jaxws:dataBinding>
           <!-- ... -->
      </jaxws:dataBinding>
</jaxws:endpoint>

But setting that results in the following error at startup:

org.springframework.beans.InvalidPropertyException: Invalid property
'dataBinding' of bean class
[org.apache.cxf.jaxws.spring.EndpointDefinitionParser$SpringEndpointImpl]:
No property 'dataBinding' found

Is it possible to set the dataBinding anyplace else?

On Mon, Nov 10, 2008 at 10:52 AM, Benson Margulies <bi...@gmail.com>wrote:

> If I recommended that you read our code in the vicinity of the class
> JAXBDataBinding, would you be annoyed? It sets up a whole series of
> JAXB options.
>
> On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
> wrote:
> > I've noticed that when I call my services using CXF, it only outputs the
> > namespaces necessary for the output objects, which is the behavior I'm
> > looking for.  If I make the same type of call outside CXF with my own
> > configured JAXB instance, JAXB dumps out all of the namespaces it knows
> > about even thought they're not needed.  CXF does the right thing while
> JAXB
> > doesn't and I'd like to know how CXF does it.
> >
> > Any help is appreciated.
> >
> > -Nick
> >
>

Re: How does CXF determine the namespaces to output?

Posted by Nick Heudecker <nh...@gmail.com>.
Thanks for the pointer.

On Tue, Nov 11, 2008 at 8:23 AM, Daniel Kulp <dk...@apache.org> wrote:

>
> The class to look at is PROBABLY the
> org.apache.cxf.jaxb.io.DataWriterImpl
> The code is a little different on trunk as I've been working on getting it
> able to use the jaxb implementation built into Java6, but it shouldn't be
> hard to follow.
>
> The "com.sun.xml.bind.defaultNamespaceRemap" property can also have some
> impact on this as well.
>
> Dan
>
>
> On Monday 10 November 2008 1:52:14 pm Benson Margulies wrote:
> > If I recommended that you read our code in the vicinity of the class
> > JAXBDataBinding, would you be annoyed? It sets up a whole series of
> > JAXB options.
> >
> > On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com>
> wrote:
> > > I've noticed that when I call my services using CXF, it only outputs
> the
> > > namespaces necessary for the output objects, which is the behavior I'm
> > > looking for.  If I make the same type of call outside CXF with my own
> > > configured JAXB instance, JAXB dumps out all of the namespaces it knows
> > > about even thought they're not needed.  CXF does the right thing while
> > > JAXB doesn't and I'd like to know how CXF does it.
> > >
> > > Any help is appreciated.
> > >
> > > -Nick
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Re: How does CXF determine the namespaces to output?

Posted by Daniel Kulp <dk...@apache.org>.
The class to look at is PROBABLY the 
org.apache.cxf.jaxb.io.DataWriterImpl
The code is a little different on trunk as I've been working on getting it 
able to use the jaxb implementation built into Java6, but it shouldn't be 
hard to follow.  

The "com.sun.xml.bind.defaultNamespaceRemap" property can also have some 
impact on this as well.

Dan


On Monday 10 November 2008 1:52:14 pm Benson Margulies wrote:
> If I recommended that you read our code in the vicinity of the class
> JAXBDataBinding, would you be annoyed? It sets up a whole series of
> JAXB options.
>
> On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com> 
wrote:
> > I've noticed that when I call my services using CXF, it only outputs the
> > namespaces necessary for the output objects, which is the behavior I'm
> > looking for.  If I make the same type of call outside CXF with my own
> > configured JAXB instance, JAXB dumps out all of the namespaces it knows
> > about even thought they're not needed.  CXF does the right thing while
> > JAXB doesn't and I'd like to know how CXF does it.
> >
> > Any help is appreciated.
> >
> > -Nick



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: How does CXF determine the namespaces to output?

Posted by Benson Margulies <bi...@gmail.com>.
If I recommended that you read our code in the vicinity of the class
JAXBDataBinding, would you be annoyed? It sets up a whole series of
JAXB options.

On Mon, Nov 10, 2008 at 1:11 PM, Nick Heudecker <nh...@gmail.com> wrote:
> I've noticed that when I call my services using CXF, it only outputs the
> namespaces necessary for the output objects, which is the behavior I'm
> looking for.  If I make the same type of call outside CXF with my own
> configured JAXB instance, JAXB dumps out all of the namespaces it knows
> about even thought they're not needed.  CXF does the right thing while JAXB
> doesn't and I'd like to know how CXF does it.
>
> Any help is appreciated.
>
> -Nick
>