users@jax-ws.java.net

Re: Controlling Generation of Beans used in WebServices Operations

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 05 Apr 2006 09:25:35 -0700

Hi Narinder,

My comments inlined,

Narinder Kumar wrote:
> 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 ?
>
No you can't. Although you can use customization to generate these beans
in specific package or rename them etc.
> 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>
>
Ok, so what I see from the wsdl and customization above, withought this
customization, wsimport should generate the exception class as
EligibilityServiceFault.java. With the above customization it should
generated EligibilityServiceException.java.
> The aim is not to have something generated like
> EligibilityServiceException.java rather
> EligibilityServiceFault_Exception.java. wsimport generates both of them.
 From the customization above you're telling wsimport to generate
EligibilityServiceException.java for the fault. Can you provide me the
complete wsdl and your customization file I will try myself to see what
makes it generate the other exception class, with _Exception suffix?
> 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.
Unfortunately no. All you can do is to rename it. Which you're doing
above. I would like to see what makes it generate 2 classes for an
exception?

-vivek.
>
> The platform details are : JWSDP2.0 EA3
>
> Many thanks in advance
> Narinder
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net For
> additional commands, e-mail: users-help_at_jax-ws.dev.java.net

-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.