users@jax-ws.java.net

RE: Making Input Parameters Required

From: Marian, Sahaya <smarian_at_shsolutions.com>
Date: Wed, 27 Dec 2006 10:50:04 -0500

Hi,

I am also looking at this information. Chris, if you find one, please
inform me too.

Thanks
Sasi


 

-----Original Message-----
From: Christopher Moesel [mailto:christopher_moesel_at_avid.com]
Sent: Wednesday, December 27, 2006 10:26 AM
To: users_at_jax-ws.dev.java.net
Subject: Making Input Parameters Required

Hello,

Is there a way to specify that input parameters should be required
(minOccurs="1" in the XSD/WSDL)? Here is an example of my Java code
w/Annotations:

@WebMethod(operationName = "myMethod", action = "urn:MyMethod")
@WebResult(name="MyResult")
MyResult myMethod( @WebParam(name="myParam1") String param1,
                   @WebParam(name="myParam2") String param2 );

This results in the following declaration in the generated XSD:

<xs:complexType name="myMethod">
  <xs:sequence>
    <xs:element name="myParam1" type="xs:string" minOccurs="0"/>
    <xs:element name="myParam2" type="xs:string" minOccurs="0"/>
  </xs:sequence>
</xs:complexType>

In this example, however, I want the generated XSD to indicate that
myParam1 and myParam2 are required (minOccurs="1"). Is there a way to
do this without needing to create my own input wrapper object?

Thanks,
Chris

---------------------------------------------------------------------
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