[jboss-user] [JBossWS] - How to set a parameter mandatory for a given operation

Vincent321 do-not-reply at jboss.com
Wed Oct 3 09:46:10 EDT 2007


Dear, 

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


  | @WebService
  | @SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
  | public class GenericWS {
  | 	public boolean postMessage(@WebParam(name = "message")Message inMessage){
  | 		
  | 		
  | 			System.out.println(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;
  | 
  | 
  |     @XmlElement(required=true)
  |     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:sequence>
  |                <xs:element minOccurs="0" name="message" type="ns1:message"/>
  |             </xs:sequence>
  |          </xs:complexType>
  | 
  | 

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

Many thanks in advance

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091062#4091062

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091062



More information about the jboss-user mailing list