You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Néstor Boscán <ne...@gmail.com> on 2012/03/09 09:41:01 UTC

Trying to define namespace for classes and exceptions

Hi

I'm using CXF that comes with JBoss 6.1.0. I would like to define
namespaces for my classes and exception classes. I defined @XmlType
annotations for my classes and exception classes but when I publish them I
only get the namespace for the objects and not for the exceptions. Is there
a way to define this configuration outside the classes?

Regards,

Néstor Boscán

Re: Trying to define namespace for classes and exceptions

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Yes that's correct, the class generated in the correct package is an empty
bean. While the class generated in the service package is an exception. Is
there a way to have the exception class in the package that I define?

Regards,

Néstor Boscán

On Mon, Mar 12, 2012 at 4:35 PM, Daniel Kulp <dk...@apache.org> wrote:

> On Monday, March 12, 2012 04:32:17 PM Néstor Boscán wrote:
> > Hi Daniel
> >
> > Thanks for the reply.
> >
> > I used @WebFault and I'm getting now two exception classes. One empty
> > exception class in the correct package, and one exception class in the
> > service package. I would like to have my exception classes generated with
> > their respective attributes in the correct package.
>
> Would need a test case for this.  Definitely should only have a single
> exception being generated.   Are you sure they are both exceptions?
>
> Most likely, the fault bean is generated in one and the exception is
> generated in the service package.  That is what I would have expected.
>
> Dan
>
>
> >
> > Regards,
> >
> > Néstor Boscán
> >
> > On Mon, Mar 12, 2012 at 2:50 PM, Daniel Kulp <dk...@apache.org> wrote:
> > > On Friday, March 09, 2012 04:11:01 AM Néstor Boscán wrote:
> > > > Hi
> > > >
> > > > I'm using CXF that comes with JBoss 6.1.0. I would like to define
> > > > namespaces for my classes and exception classes. I defined @XmlType
> > > > annotations for my classes and exception classes but when I publish
> > > > them
> > >
> > > I
> > >
> > > > only get the namespace for the objects and not for the exceptions.
> > >
> > > THe namespace for the faults would be on the @WebFault annotation.
> > >
> > > > Is
> > > > there a way to define this configuration outside the classes?
> > >
> > > Not easily, no.   You can write a custom subclass of
> > > org.apache.cxf.service.factory.AbstractServiceConfiguration that maps
> > > everything any way you want, but that would be quite a bit of work.
> > >
> > > > Regards,
> > > >
> > > > Néstor Boscán
> > >
> > > --
> > > Daniel Kulp
> > > dkulp@apache.org - http://dankulp.com/blog
> > > Talend Community Coder - http://coders.talend.com
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>

Re: Trying to define namespace for classes and exceptions

Posted by Daniel Kulp <dk...@apache.org>.
On Monday, March 12, 2012 04:32:17 PM Néstor Boscán wrote:
> Hi Daniel
> 
> Thanks for the reply.
> 
> I used @WebFault and I'm getting now two exception classes. One empty
> exception class in the correct package, and one exception class in the
> service package. I would like to have my exception classes generated with
> their respective attributes in the correct package.

Would need a test case for this.  Definitely should only have a single 
exception being generated.   Are you sure they are both exceptions?

Most likely, the fault bean is generated in one and the exception is 
generated in the service package.  That is what I would have expected.

Dan


> 
> Regards,
> 
> Néstor Boscán
> 
> On Mon, Mar 12, 2012 at 2:50 PM, Daniel Kulp <dk...@apache.org> wrote:
> > On Friday, March 09, 2012 04:11:01 AM Néstor Boscán wrote:
> > > Hi
> > > 
> > > I'm using CXF that comes with JBoss 6.1.0. I would like to define
> > > namespaces for my classes and exception classes. I defined @XmlType
> > > annotations for my classes and exception classes but when I publish
> > > them
> > 
> > I
> > 
> > > only get the namespace for the objects and not for the exceptions.
> > 
> > THe namespace for the faults would be on the @WebFault annotation.
> > 
> > > Is
> > > there a way to define this configuration outside the classes?
> > 
> > Not easily, no.   You can write a custom subclass of
> > org.apache.cxf.service.factory.AbstractServiceConfiguration that maps
> > everything any way you want, but that would be quite a bit of work.
> > 
> > > Regards,
> > > 
> > > Néstor Boscán
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog
> > Talend Community Coder - http://coders.talend.com
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Trying to define namespace for classes and exceptions

Posted by Néstor Boscán <ne...@gmail.com>.
Yes that's correct, the class generated in the correct package is an empty
bean. While the class generated in the service package is an exception. Is
there a way to have the exception class in the package that I define?

Regards,

Néstor Boscán

On Mon, Mar 12, 2012 at 4:32 PM, Néstor Boscán <ne...@tcs.com.ve>wrote:

> Hi Daniel
>
> Thanks for the reply.
>
> I used @WebFault and I'm getting now two exception classes. One empty
> exception class in the correct package, and one exception class in the
> service package. I would like to have my exception classes generated with
> their respective attributes in the correct package.
>
> Regards,
>
> Néstor Boscán
>
>
> On Mon, Mar 12, 2012 at 2:50 PM, Daniel Kulp <dk...@apache.org> wrote:
>
>> On Friday, March 09, 2012 04:11:01 AM Néstor Boscán wrote:
>> > Hi
>> >
>> > I'm using CXF that comes with JBoss 6.1.0. I would like to define
>> > namespaces for my classes and exception classes. I defined @XmlType
>> > annotations for my classes and exception classes but when I publish
>> them I
>> > only get the namespace for the objects and not for the exceptions.
>>
>> THe namespace for the faults would be on the @WebFault annotation.
>>
>> > Is
>> > there a way to define this configuration outside the classes?
>>
>> Not easily, no.   You can write a custom subclass of
>> org.apache.cxf.service.factory.AbstractServiceConfiguration that maps
>> everything any way you want, but that would be quite a bit of work.
>>
>>
>> >
>> > Regards,
>> >
>> > Néstor Boscán
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>>
>>
>

Re: Trying to define namespace for classes and exceptions

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi Daniel

Thanks for the reply.

I used @WebFault and I'm getting now two exception classes. One empty
exception class in the correct package, and one exception class in the
service package. I would like to have my exception classes generated with
their respective attributes in the correct package.

Regards,

Néstor Boscán

On Mon, Mar 12, 2012 at 2:50 PM, Daniel Kulp <dk...@apache.org> wrote:

> On Friday, March 09, 2012 04:11:01 AM Néstor Boscán wrote:
> > Hi
> >
> > I'm using CXF that comes with JBoss 6.1.0. I would like to define
> > namespaces for my classes and exception classes. I defined @XmlType
> > annotations for my classes and exception classes but when I publish them
> I
> > only get the namespace for the objects and not for the exceptions.
>
> THe namespace for the faults would be on the @WebFault annotation.
>
> > Is
> > there a way to define this configuration outside the classes?
>
> Not easily, no.   You can write a custom subclass of
> org.apache.cxf.service.factory.AbstractServiceConfiguration that maps
> everything any way you want, but that would be quite a bit of work.
>
>
> >
> > Regards,
> >
> > Néstor Boscán
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>

Re: Trying to define namespace for classes and exceptions

Posted by Daniel Kulp <dk...@apache.org>.
On Friday, March 09, 2012 04:11:01 AM Néstor Boscán wrote:
> Hi
> 
> I'm using CXF that comes with JBoss 6.1.0. I would like to define
> namespaces for my classes and exception classes. I defined @XmlType
> annotations for my classes and exception classes but when I publish them I
> only get the namespace for the objects and not for the exceptions.

THe namespace for the faults would be on the @WebFault annotation.

> Is
> there a way to define this configuration outside the classes?

Not easily, no.   You can write a custom subclass of 
org.apache.cxf.service.factory.AbstractServiceConfiguration that maps 
everything any way you want, but that would be quite a bit of work.


> 
> Regards,
> 
> Néstor Boscán
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com