• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

validating soap response

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to validate soap response, tried googling for that, but mostly .net links availabale.
can anybody provide some pointers to it or the strategy one should follow,
like should i go for a schema kind of validation or there are other options.
if its a schema type validation, should we use only standard schemas or they can be modified.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kinds of validations are you thinking of? If the response is not well-formed SOAP, then the SOAP engine will throw an exception anyway.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by gaurav abbi:
if its a schema type validation, should we use only standard schemas or they can be modified.



An XML Schema aware parser can validate XML against standard schemas or your own schemas.

For performance reasons many web services toolkits don't support automatic validation that can simply be turned on. For non-document-oriented web services the toolkit will generate the (un)marshalling code which will detect many errors anyway. And for document-oriented web services the resulting XML document can be validated by the usual means.

javax.xml.validation example
Using the Validating Parser

Some XML parsers will let you validate against a DTD, however SOAP web services use XML Schema inside the definition/description of the service contract with WSDL, so XML schema is usually used for validation as well.

It isn't uncommon for responses that are generated within you own trust boundaries (usually the intra-net) to go un-validated as validation can decrease performance. Requests/Responses that originate from outside of your trust boundaries should be validated however.

XML Schema supports the "any" and "anyType" which will accept any well formed XML. These are sometimes useful - however they can complicate the validation process as it becomes necessary to classify the content before either validating it separately or selecting the correct (more restrictive) schema for validation.

Loosely typed versus strongly typed Web services
Tip: xsd:any: A cautionary tale
Realizing Strategies for Document-Based Web Services With JAX-WS 2.0: Part 3 in a Series
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic