From: <ani...@jb...> - 2005-07-17 17:22:47
|
Now that the schema model is described. Let me give a background into what our approach at creating the schema model is for the two tasks: Java -> wsdl and wsdl -> Java. WSDLToJava is an easier process. Use WSDL4J to obtain the WSDL model. It treats schema definitions as an extensibility elements. While parsing the wsdl, we move the schema definitions to temp files and then use XMLSchemaLoader from Xerces schema implementation to parse the various schema definitions. (An issue I have noticed is that the XMLSchemaLoader accepts one schema definition block in a single file. So if there are multiple schema definitions, they should all be moved to different files. Ahh...) By parsing, we have built a single XSModel that represents the target namespace. This XSModel will be plugged into WSDLTypes. Now comes the tricky part, JavaToWSDL was tough because we cannot use the Xerces implementation of the Xerces Schema API because the Xerces team advised us not to use their implementation to create schemas, as the implementation is subject to change. So we were left with no choice but to implement our version of the Xerces Schema API. When we are converting Java types to a wsdl, we know the targetnamespace. We create a XSModel with the targetnamespace and all schema types that are generated by the JavaToXSD subsystem are added to this XSModel. Now the XSModel basically looks at the namespace of the type that is being added and then adds it to the namespaceitem that represents the namespace of the type being added. Positives: - One XSModel that is smart enough to manage the schema model. - Flat model. All we have is namespace items which deal with their types. Negative: Not a lot of information kept in the schema model to serialize it back to schema files. Workaround: JBossXSModel (JBoss implementation of Xerces Schema API) has additional information stored, that will allow us to serialize the schema model back to schema files. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885204#3885204 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885204 |