File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Validating input data passed to web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Validating input data passed to web service" Watch "Validating input data passed to web service" New topic

Validating input data passed to web service

tushar joshi

Joined: Feb 08, 2005
Posts: 10
Hi Friends,

i have one urgent problem
is that validating input data
on web service side for e.g
compulsory fields,field
length,field value etc.

Our application have one
service which insert data into
database by taking input from
soap client.
As soap client may be another
application in any language.
so no gui is available to
validate input data.

We need to validate like
compulsory fields,field length

Tell me how i can do this
easily rather than checking
field by field validation.

Thanks in advance

JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
You can validate your XML in "one shot" using XML Schema (XSD File)

/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Karthik Mohan

Joined: Sep 29, 2004
Posts: 23
if you use an api like XMLBeans, you can validate the data very easily.
tushar joshi

Joined: Feb 08, 2005
Posts: 10
Thanks a lot Jean-Louis Marechaux,Karthik

sorry but i am newbie in web i don't have any idea on XSD Scema and XML Beans.can u please explain me more and give some useful links.

I tell u my current situation so that u will get better idea.

I have my one data object which contain name,address etc which is passed on SOAP.
now after receiving data object on web service side,
i have to check whether Name is entered or not as Name is compulsory.
As well as length of both should be as per specified in database

So how to validate such things.
Thanks a lot for ur immediate help.

Please give me urgent reply as per requirements.

I agree. Here's the link:
subject: Validating input data passed to web service
It's not a secret anymore!