XML & Web services: xml request message validation error

  1. xml request message validation error (1 messages)

    Hi, My request message is : <!--?xml version="1.0" encoding="utf-8"?--> 11 20 and my xsd schema to validate the request message against are as follows: REQUEST.XSD <!--?xml version="1.0" encoding="utf-8"?--> REQUEST_APP1.XSD <!--?xml version="1.0" standalone="yes"?--> REQUEST_APP2.XSD <!--?xml version="1.0" standalone="yes"?--> My validation code is: public void validateRequest(ByteArrayInputStream isReqMsg) throws SAXException, IOException { SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); File schemaLocation = new File("request.xsd"); try { Schema schema = factory.newSchema(schemaLocation); Validator validator = schema.newValidator(); validator.validate(new StreamSource(isReqMsg)); System.out.println("Request message is valid."); } catch (SAXException ex) { System.out.println("Request message is invalid because "); System.out.println(ex.getMessage()); System.out.println(ex.getStackTrace()); throw ex; } catch(IOException ie) { System.out.println("Cannot read message because "); System.out.println(ie.getMessage()); throw ie; } } The validator gives me the following error: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '#id0' is not a valid value for 'integer'. Can anybody help spot the error? Thanks!! Karan
  2. Re: xml request message validation error[ Go to top ]

    check this link: http://mail-archives.apache.org/mod_mbox/xerces-j-users/200403.mbox/%3COF4A60B22F dot D1913C85-ON85256E5F dot 00822702-85256E5F dot 0082F6FE at ca dot ibm dot com%3E cheers, http://www.javaicillusion.blogspot.com/