<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to check mandatory fields in wsdl</title><link>https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl</link><description>&lt;p&gt;Hi guys,
Could you help me with this issue.
Is there anyway that we can validate the required field in Ivy Webservice?
Example add the property required = true, But it's only not generate the comment optional in Webservice request. It still can pass if I leave it empty.
@XmlElement(name = "ProcessType", required = true)
&lt;img alt="alt text" src="http://i.imgur.com/hEDDa82.png"&gt;&lt;/p&gt;
&lt;p&gt;I also try to add nillable = true but it did not help.&lt;/p&gt;
&lt;p&gt;If any body have the idea please give me a hand. 
Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 11 Oct 2016 04:22:34 -0400</lastBuildDate><item><title>Answer by Hap Em</title><link>https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl/2092</link><description>&lt;p&gt;Actually, I declared like this in my project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@XmlAccessorType(XmlAccessType.FIELD)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;public class WSInputParamModel {&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@XmlTransient
private Date reportStartDate;

@XmlTransient
private BigDecimal mainProjectKey;

@XmlElement(required = true)
public BigDecimal getMainProjectKey() {
    return mainProjectKey;
}
public void setMainProjectKey(BigDecimal mainProjectKey) {
    this.mainProjectKey = mainProjectKey;
}

@XmlElement(required = true)
public Date getReportStartDate() {
    return reportStartDate;
}

public void setReportStartDate(Date reportStartDate) {
    this.reportStartDate = reportStartDate;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hap Em</dc:creator><pubDate>Tue, 11 Oct 2016 04:22:34 -0400</pubDate><guid>https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl/2092</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl/2088</link><description>&lt;p&gt;Normally the &lt;code&gt;@XmlElement(required=true)&lt;/code&gt; annotation should be sufficient. See &lt;a href="http://answers.axonivy.com/questions/925/how-can-i-make-a-parameter-of-a-webservice-process-required"&gt;http://answers.axonivy.com/questions/925/how-can-i-make-a-parameter-of-a-webservice-process-required&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you share your WSDL?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 10 Oct 2016 16:51:08 -0400</pubDate><guid>https://answers.axonivy.com/questions/2085/how-to-check-mandatory-fields-in-wsdl/2088</guid></item></channel></rss>