users@jax-ws.java.net

Controlling Generation of Beans used in WebServices Operations

From: Narinder Kumar <nkumarfr_at_aol.com>
Date: Wed, 29 Mar 2006 16:44:09 +0200
Hi,

I have query regarding wsimport tool and beans used in WebService Operations.

Following are WSDL and WebService details :

--ComplexType Definitions---
   <complexType name="TechnicalEligibilityRequest">
       <sequence>
          <element name="phoneNumber" type="xsd:string" />
       </sequence>
   </complexType>
   <element type="tns:TechnicalEligibilityRequest" name="TechnicalEligibilityRequest"/>

   <complexType name="TechnicalEligibilityResponse">
       <sequence>
          <element name="eligibilityResult" type="xsd:int" />
       </sequence>
   </complexType>
   <element type="tns:TechnicalEligibilityResponse" name="TechnicalEligibilityResponse"/>

   <complexType name="EligibilityServiceFault">
        <sequence>
           <element name="faultInfo" type="xsd:string" />
           <element name="message" type="xsd:string" />
        </sequence>
   </complexType>
   <element type="tns:EligibilityServiceFault" name="EligibilityServiceFault"/>

--Message Details--
<message name="TechnicalEligibilityRequest">
    <part name="TechnicalEligibilityRequest" element="tns:TechnicalEligibilityRequest" />
</message>

<message name="TechnicalEligibilityResponse">
    <part name="TechnicalEligibilityResponse" element="tns:TechnicalEligibilityResponse" />
</message>

<message name="EligibilityServiceFault">
    <part name="EligibilityServiceFault" element="tns:EligibilityServiceFault" />
</message>

--Details about PortType---
<portType name="EligibilityPortType">
       <operation name="getTechnicalEligibility">
            <input message="tns:TechnicalEligibilityRequest" name="TechnicalEligibilityRequest"/>
            <output message="tns:TechnicalEligibilityResponse" name="TechnicalEligibilityResponse"/>
            <fault message="tns:EligibilityServiceFault" name="EligibilityServiceFault"/>           
       </operation>
</portType>

Java Objects (Beans) like TechnicalEligibilityRequest, TechnicalEligibilityResponse etc are shared both by Clients and Servers and implemented seperately. On the client side I would like to use wsimport to generate ServiceEndPoint, PortType and other classes required for calling WebService only, but would like to use my own beans rather than get them generated. Can we control the behaviour of wsimport ?

According to JAX-WS customization document, we can customize Exception Class naming. I tried to do something like :

    <bindings node="wsdl:definitions/wsdl:portType[@name='EligibilityPortType']/wsdl:operation[@name='getTechnicalEligibility']/wsdl:fault[@name='EligibilityServiceFault']">
        <class name="EligibilityServiceException">
        <javadoc>Exception generated during eligibility checking</javadoc>
        </class>
    </bindings>

The aim is not to have something generated like
EligibilityServiceException.java rather EligibilityServiceFault_Exception.java. wsimport generates both of them. Again is there a way to change this behaviour and similar to Java beans above not to generate this Exception class at all but using the one implemented seperately.

The platform details are : JWSDP2.0 EA3

Many thanks in advance
Narinder