Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to require min and max string length for param in wsdl file?

Tags:

soap

wsdl

I am creating a web service using php SOAPServer. I am creating a wsdl file and looking for info on how to set the min and max string length for one of the input parameters for one of the web service operations. Is it even possible?

By the way I am using soap binding style "rpc"

like image 990
Dmitri Snytkine Avatar asked Nov 16 '11 13:11

Dmitri Snytkine


1 Answers

Do you code the WSDL by hand or does the library create it for you by looking at an endpoint class? If you are coding the WSDL by hand, you could simply add something like this in your schema descriptor:

<simpleType name="MyStringType">
      <restriction base="string">
         <minLength value="10" />
         <maxLength value="30" />
      </restriction>
   </simpleType>
   <element name="greetMe">
      <complexType>
         <sequence>
            <element name="requestType" 
               type="tns:MyStringType"/>
         </sequence>
      </complexType>
   </element>
like image 82
Jeshurun Avatar answered Sep 22 '22 12:09

Jeshurun