Hi Dan,

>> The only options I know of to specify the namespace is via annotation or
>> package-info both of which do not work for an Exception.
>
> You may need to setup the exception to look like one that is generated from
> wsdl2java.   That would mean that is would have a getFaultInfo() method that
> returns a JAXB bean of the information that would be transferred.   THAT
> object should be able to have all the JAXB annotations on it to set the
> namespaces and such.    Take your wsdl and run a wsdl2java on it to see what
> it generates for the faults and use that as a starting point.

Yes - I am able to control the package/namespace of the fault bean.
However I want to be able to control the package/namespace of the
Exception itself. Is that possible?

Cheers
rouble

> Dan
>
>
>
>>
>> cheers
>> rouble
>>
>> On Fri, Jul 6, 2012 at 10:44 AM, Glen Mazza <[email protected]> wrote:
>> > My blog article needs updating (soon on my list):
>> > http://www.jroller.com/gmazza/entry/updating_database_tables_using_jaxws
>> > ,
>> > and I haven't tried this, but it appears you can specify the namespace,
>> > and hence the generated class name for the exception, as shown in Step
>> > #4 which lists the WSDL:
>> >
>> > <wsdl:operation name="AddEmployee">
>> > <wsdl:input message="tns:AddEmployeeRequest" />
>> > <wsdl:output message="tns:AddEmployeeResponse" />
>> > <wsdl:fault message="tns:DataProcessingFault"
>> >
>> >            name="DataProcessingFault" />
>> >
>> > </wsdl:operation>
>> >
>> > tns:DataProcessingFault suggests I can use
>> > anythingelse:DataProcessingFault instead, and the exception will go
>> > into a separate package whose name will be a function of that
>> > namespace.
>> >
>> > The third paragraph of this article:
>> > http://www.jroller.com/gmazza/entry/enhancing_jaxb_artifacts points to
>> > links on using JAX-WS (not JAXB) customization files, that might also
>> > help.
>> >
>> > Glen
>> >
>> > On 07/06/2012 09:22 AM, rouble wrote:
>> >> 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
> --
> Daniel Kulp
> [email protected] - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Reply via email to