Discussions

XML & Web services: Validation of XML Payload in request

  1. Validation of XML Payload in request (1 messages)

    Hi, I have written a document/literal style web service that takes DOM Document as input and returns a DOM Document . In doc/lit style web services the DOM document will be opened and passed as XML payload in the request message. I want to validate this xml payload in the wsdl. Any ideas about how i can do this?
  2. Do you use any framework, e.g. a jax-rpc framework like AXIS or JWSDP? I don't think you can validate input/output to a WSDL document, but if you put all your data in a separate .xsd file (which can be imported from the WSDL), you can validate the XML messsages to this schema. A simple approach to validating XML in Java is the validation API (javax.xml.validation) in JAXP1.3, see for example https://jaxp.dev.java.net/article/jaxp-1_3-article.html . An implementation is included by java 5 by default, but can also be used with jdk1.4 .