Hi Sergey et al,

Why don't namespaces of exceptions follow the same rules as other data
objects? They seem to ignore the package-info and the annotations. Is
this a bug?

tia,
rouble

On Fri, Jul 6, 2012 at 5:52 AM, Sergey Beryozkin <[email protected]> wrote:
> Hi
>
> On 05/07/12 22:09, rouble wrote:
>>
>> CXF Gurus,
>>
>> I have a web service in which every method throws an Exception (called
>> MyException). Now, it does not matter what namespace I try to set for
>> the Exception it always fall under the namespace of the Service. I
>> have tried using a package-info file and @XmlRootElement(namespace =
>> "some.package") - neither take.
>>
>> A side effect of this is that if I have N web services that use the
>> same exception, for instance:
>> http://example.com/myfirstwebservice/v1/
>> http://example.com/myfirstwebservice/v2/
>> http://example.com/mysecondwebservice/v1/
>>
>> They will all have N different versions of the exact same exception.
>> So, if a web client was to deal with more than one web service it will
>> need to explicitly handle the different versions of the same
>> exception.
>>
>> Is there a way to specify/force the namespace of an exception to be
>> different than the namespace of the service?
>>
> I'm not sure how it can be managed at the JAX-WS level, however
> Transformation Feature may help:
> http://cxf.apache.org/docs/transformationfeature.html
>
> I think you can configure either each individual endpoint to adapt the
> exception namespace to the one expected by the client or configure
> individual clients to convert multiple namespaces to the single one
> recognized by this client
>
> HTH, Sergey
>
>> tia,
>> rouble
>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com

Reply via email to