Re: How to use WSDL to validate soap message?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Please read a doc on data binding and please 1. do not cross post 2. do not use dev-list to ask non-architectural questions. Chinthaka Wenshuang Sun wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHHZ85jON2uBzUhh8RAtRGAJ9cQZIkS6+HQVieeCgzRFoPU4tuzACgldY2 Q9NuWsytX9oEaM19DTE5u/w= =y11O -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use WSDL to validate soap message?
Eran Chinthaka wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Please read a doc on data binding and please 1. do not cross post 2. do not use dev-list to ask non-architectural questions. Chinthaka Wenshuang Sun wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHHZ85jON2uBzUhh8RAtRGAJ9cQZIkS6+HQVieeCgzRFoPU4tuzACgldY2 Q9NuWsytX9oEaM19DTE5u/w= =y11O -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I've actually used the lib from Xerces. You need xml-apis.jar from there. Then I placed my .xsd files in the root of the archive file (aar) and my validation method is like this: public String validate(String schemaFile, OMElement xml) { String returnMessage = null; try { SchemaFactory schemaFactory = SchemaFactory.newInstance(http://www.w3.org/2001/XMLSchema;); Schema schemaXSD = schemaFactory.newSchema(this.getClass().getResource(/ + schemaFile)); Validator validator= schemaXSD.newValidator(); DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); InputSource docSource = new InputSource(new StringReader(xml.toString())); Document document = parser.parse(docSource); validator.validate(new DOMSource(document)); } catch (Exception e) { e.printStackTrace(); returnMessage = e.toString(); // Clear the org.xml.sax.SAXParseException from the string returnMessage = returnMessage.replaceAll( org\\.xml\\.sax\\.SAXParseException: , ); } return returnMessage; } For small messages I have not noticed a delay in the validation. But I still need to check with attachments. Also notice the / in the getResource. This is crucial for finding the schema file in the archive.
How to use WSDL to validate soap message?
Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use WSDL to validate soap message?
On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Axis2 validates your SOAP message according to the schema defined in your WSDL. This is done by default hence you dont need to do anything specifically to get this done. Thanks, Keith. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/
Re: How to use WSDL to validate soap message?
Hi, Thanks. what's the version of axis2 that support what you said? 1.2 or 1.3? Best Regards. Wenshuang 2007/10/22, keith chapman [EMAIL PROTECTED]: On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Axis2 validates your SOAP message according to the schema defined in your WSDL. This is done by default hence you dont need to do anything specifically to get this done. Thanks, Keith. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use WSDL to validate soap message?
Its a core feature hence Do in both, but always better to use the latest (1.3) Thanks Lahiru On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, Thanks. what's the version of axis2 that support what you said? 1.2 or 1.3 ? Best Regards. Wenshuang 2007/10/22, keith chapman [EMAIL PROTECTED]: On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Axis2 validates your SOAP message according to the schema defined in your WSDL. This is done by default hence you dont need to do anything specifically to get this done. Thanks, Keith. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks Lahiru Sandakith http://sandakith.wordpress.com/ GPG Key Fingerprint : 8CD8 68E0 4CBC 75CB 25BC 1AB1 FE5E 7464 1F01 9A0F
Re: How to use WSDL to validate soap message?
Actually, that's not quite accurate. Axis2 does not automatically validate messages -- at least not from a true schema validation perspective. If are using a data binding framework, then the data binding framework will generate errors if required elements are missing or the element content doesn't conform to the expected schema type. But that's not the same as schema validation. If you have constraints on an element (patterns, occurrence, referential integrity, etc), the data binding framework won't catch them. And, if you aren't using a data binding framework, then Axis2 won't do any type of message validation. If you really want to validate messages before or after processing, you should engage a module to validate the messages using schema validation. Please bear in mind, though, that schema validation is a very expensive process, so use this option with discretion. Anne On 10/22/07, Lahiru Sandakith [EMAIL PROTECTED] wrote: Its a core feature hence Do in both, but always better to use the latest (1.3) Thanks Lahiru On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, Thanks. what's the version of axis2 that support what you said? 1.2 or 1.3? Best Regards. Wenshuang 2007/10/22, keith chapman [EMAIL PROTECTED]: On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Axis2 validates your SOAP message according to the schema defined in your WSDL. This is done by default hence you dont need to do anything specifically to get this done. Thanks, Keith. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks Lahiru Sandakith http://sandakith.wordpress.com/ GPG Key Fingerprint : 8CD8 68E0 4CBC 75CB 25BC 1AB1 FE5E 7464 1F01 9A0F - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use WSDL to validate soap message?
Thank you very much. 2007/10/22, Anne Thomas Manes [EMAIL PROTECTED]: Actually, that's not quite accurate. Axis2 does not automatically validate messages -- at least not from a true schema validation perspective. If are using a data binding framework, then the data binding framework will generate errors if required elements are missing or the element content doesn't conform to the expected schema type. But that's not the same as schema validation. If you have constraints on an element (patterns, occurrence, referential integrity, etc), the data binding framework won't catch them. And, if you aren't using a data binding framework, then Axis2 won't do any type of message validation. If you really want to validate messages before or after processing, you should engage a module to validate the messages using schema validation. Please bear in mind, though, that schema validation is a very expensive process, so use this option with discretion. Anne On 10/22/07, Lahiru Sandakith [EMAIL PROTECTED] wrote: Its a core feature hence Do in both, but always better to use the latest (1.3) Thanks Lahiru On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, Thanks. what's the version of axis2 that support what you said? 1.2 or 1.3? Best Regards. Wenshuang 2007/10/22, keith chapman [EMAIL PROTECTED]: On 10/22/07, Wenshuang Sun [EMAIL PROTECTED] wrote: Hi, How to use WSDL to validate the soap message in axis2, is the API about the function provided? Axis2 validates your SOAP message according to the schema defined in your WSDL. This is done by default hence you dont need to do anything specifically to get this done. Thanks, Keith. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks Lahiru Sandakith http://sandakith.wordpress.com/ GPG Key Fingerprint : 8CD8 68E0 4CBC 75CB 25BC 1AB1 FE5E 7464 1F01 9A0F - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]