+ Start a Discussion
Jyosi jyosiJyosi jyosi 

Apex Web services Class Minoccur=1

Hello All ,

I need to make the field required in Apex webservices class

I have variable  firstName and it should be mandatory in services 

webservice string firstName; is the syntax.When i generate the schema it's shows as below.
<xsd:element name="firstName" minOccurs="0" type="xsd:string" nillable="true"/>
how to make the minOccurs="1" through apex class
<xsd:element name="firstName" minOccurs="1" type="xsd:string" nillable="true"/>

Thanks for help.

Ashok N
Purushotham YellankiPurushotham Yellanki

When you make your field required on field level then it sets minOccurs=1 and that is how it referes in your WSDL when exported
Jyosi jyosiJyosi jyosi
Hello Purushotham Yellanki,

We dont want to make on field level,We need to do in Apex class is there any way we can do that ?

Thanks for the help.