• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web services Input data validation

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In the wsdl, we had some constraints on the input data.

For eg:-
<xsd:element minOccurs="1" name="DomainID">
<xsd:simpleType>
<xsd:restriction base="int">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="999"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

Web services client & server are implemented in Java. Here the Client builds the DomainID java object and invokes an operation and passes DomainID. Code works fine even if the client sets a value i.e out of range from 0-999. Right now I am validating the data manually on the server side.

Since on the server side I am receiving java object as input, I can NOT use schema defined in WSDL for validation.

Does anyone of you know IF there is a way to inform SOAP Runtime dont send the soap message to the server if input is not valid as per the schema defined in WSDL??

Please share your thoughts on this.

Thanks,
Janardhan.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Janardhan Kotha:
Does anyone of you know IF there is a way to inform SOAP Runtime dont send the soap message to the server if input is not valid as per the schema defined in WSDL??



You haven't indicated which web service API (JAX-RPC, JAX-WS) and which Web service toolkit (Axis, Axis 2, Glassfish Apache CXF, etc.) you are using.

Many SOAP web service toolkits do not validate incoming documents against the schema for performance reasons. And if they did you would need to be able to configure how schema validation errors map to SOAP faults (which themselves need to appear in the WSDL).

So the only recourse is to develop a SOAP Message handler that validates the incoming document and then issue an appropriate SOAP fault if the validation fails.

Writing a Handler in JAX-WS
How to create a simple JAX-RPC handler
 
Janardhan Kotha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peer Reynders.

We are using Websphere runtime for web services and JAX-RPC in client side.

Do you know by any chance if IBM has any option to enable the data validation by schema?

Thanks,
Janardhan.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Janardhan Kotha:
Thanks Peer Reynders.

We are using Websphere runtime for web services and JAX-RPC in client side.

Do you know by any chance if IBM has any option to enable the data validation by schema?

Thanks,
Janardhan.



Hello. I have exactly the same issue. Did you ever find a means of doing this?

Thanks.

-Chris
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic