This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Services and the fly likes WSDL/XSD/SOAP Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL/XSD/SOAP Validation" Watch "WSDL/XSD/SOAP Validation" New topic
Author

WSDL/XSD/SOAP Validation

Amit Chawla
Greenhorn

Joined: Mar 26, 2001
Posts: 15
I am developing SOAP web service. This web service expects a complex set of inputs from the user performs analytics on the data and returns calculation results.
The input business objects are modeled using XSD. I need to be able to specify business rules on the input data, such as:
- Decimal value should be between 1 and 100
- Date should not be less a certain date
- String length should not be greater than a certain number
Is it possible to build these rules in the WSDL/XSD itself?
Senthil Panneer Selvam Kumar
Greenhorn

Joined: Mar 28, 2003
Posts: 2
Hi,
You can do it on XSD.
Decimal data validation,
<simpleType name='Comp_Pr'>
<restriction base='decimal'>
<fractionDigits value='1'/>
<minInclusive value='1.0'/>
<maxInclusive value='100.0'/>
</restriction>
</simpleType
For the date validation, you can use the following rules.
pattern
enumeration
whiteSpace
maxInclusive
maxExclusive
minInclusive
minExclusive
String Length:
<simpleType name='input_string'>
<restriction base='string'>
<maxLength value='50'/>
</restriction>
</simpleType>
Hope this might help you.
 
GeeCON Prague 2014
 
subject: WSDL/XSD/SOAP Validation