Thanks for reply, but this is not the way I can use :-(

I need generate exceptions binding with different names on the server or not
to generate XMLBeans for them ... and question is how to do it.

The best way will be to push AXIS2 generator to generate exception classes
with different name or dont generate them - based on string pattern or list of
the classes or.

I'm able to rewrite/update source code of the XMLBeans generator, but where to
start ??? - I know debugging ... but.

Thanks

     Pat


>>How can I do this ??? Or is there a better way how to do it ???
>>
>
>
>I'm not a fan of throwing exceptions with web services. There are those that 
>try - search the list and the subject comes up frequently. 
>
>What has always worked for me is to use 'extension base´ on all your return 
>types. Such as: 
>
>      <complexType name="ReturnWebBase">
>       <sequence>
>          <element name="errorMessage" type="xsd:string"/>
>          <element name="successErrorCode" type="xsd:int"/>
>        </sequence>
>      </complexType>
>      <element name="wiseLogin">
>        <complexType>
>          <sequence>
>            <element name="user_name" type="xsd:string"/>
>            <element name="user_password" type="xsd:string"/>
>          </sequence>
>        </complexType>
>      </element>
>      <element name="wiseLoginResponse">
>        <complexType>
>          <complexContent>
>            <extension base="tns:ReturnWebBase">
>              <sequence>
>                <element name="soap_session_id" type="xsd:string"/>
>                <element name="web_user_name" type="xsd:string"/>
>              </sequence>
>            </extension>
>          </complexContent>
>        </complexType>
>      </element>
>
>So wiseLoginResponse extends ReturnWebBase. Any other services follows the 
>same pattern. In code it looks like: 
>
>try {
>                ...
>                retElement.setWebUserName(userName);
>                retElement.setSoapSessionId(
>                        authenticator.provisionSoapSessionId(userName));
>                 retElement.setErrorMessage(MessagesCodes.getMessage(
>                        MessagesCodes.SUCCESS));
>                 retElement.setSuccessErrorCode(MessagesCodes.SUCCESS);
> } catch (Exception ex) {
>            logger.error("SWAWiseEndpointSkeleton.wiseLogin:"
>                    + ex.getMessage(), ex);
>            retElement.setErrorMessage(ex.getMessage());
>            retElement.setSuccessErrorCode(MessagesCodes.FAILURE);
> }
>
>Of course there is always going to be those that prefer WSDL:Fault . Here's a 
>good explanation - although its based on jax-rpc which axis2 doesn't support 
>yet. 
>
>http://www.developer.com/java/web/article.php/3493491
>
>HTH,
>Robert 
>http://www.braziloutsource.com/
>
>Em Quarta 08 Março 2006 13:27, o pat escreveu:
>
>> Hi all,
>>
>> I have a problem with generated XMLBeans for the AXIS2.
>>
>> On server side I have something like this:
>>
>> public class A {
>>      public void method() throws MyException{...}
>> }
>>
>> When I deploy it and generated Java sources from generated WSDL file, the
>> MyException is generated as an XMLBean and the sources look like this:
>> mypackage.MyException - is an interface
>> mypackage.impl.MyExceptionImpl - is the interface implementation
>>
>> So, and I want to change the mypackage to something different (e.g.
>> mypackagex), because I want to use the original exception in the client
>> side (I know I have to update the stub). The final state will be:
>> mypackagex.MyException
>> mypackagex.impl.MyExceptionImpl
>>
>> The communication I want should be:
>> 1) at server side is thrown mypackage.MyException
>> 2) througn AXIS2 the exception will be transported as
>> mypackagex.MyException (mypackagex.impl.MyException)
>> 3) at client side I'll receive mypackagex.MyException (its implementation)
>> 4) on the client side I can use mypackage.MyException
>>
>> How can I do this ??? Or is there a better way how to do it ???
>>
>> Thanks a lot.
>>
>>      Pat

Reply via email to