4 Replies Latest reply on May 10, 2011 4:07 PM by Peer Bech Hansen

    How to set a parameter mandatory for a given operation

    Vincent Jassogne Newbie


      Could you please tell me how can I set a parameter mandatory in my WS. Below is the code of my WS

      public class GenericWS {
       public boolean postMessage(@WebParam(name = "message")Message inMessage){
       return true;

      Here is the code of my Message Bean :

      public class Message implements Serializable{
       private static final long serialVersionUID = 1L;
       private String theField;
       public String getTheField() {
       return theField;
       public void getTheField(String value) {
       this.theField = value;

      Here is a part of the generated WSDL

       <xs:complexType name="postMessage">
       <xs:element minOccurs="0" name="message" type="ns1:message"/>

      My question is : Is it possible to remove the minOccurs="0" ?

      Many thanks in advance