i got #2 done. #1 seems like tall order for me :) On 1/14/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote: > > Hi, Dims, > > Davanum Srinivas wrote: > > > #1: if there are some namespace/prefix combination is used inside an > > embedded schema but defined in the top of the wsdl file, then there is > > no way to pass it down to XSParser. (for example, XmlBeans has a > > XmlOptions class takes with a setLoadAdditionalNamespaces method which > > can be used to set such a map) > > how do you store the WSDL internally? As a DOM tree? In that case I do > suggest the following: > > - Create an instance of XMLFilterImpl, which holds the schema element > and an empty InputSource() as internal fields. (Same InputSource, > which you'll pass to the generator later on.) > - Overwrite the XMLFilter's method parse(InputSource) as follows: > Check, whether the InputSource is the same as the XMLFilter's internal > one. If not, throw an IllegalStateException. Otherwise, create an > instance of DOMSerializer. Note the DOMSerializer's property > parentsNamespaceDeclarationDisabled > Invoke the DOMSerializer's method serialize with the schema element. > > In other words, invoking the XMLFilter is equivalent to parsing the > WSDL's schema with the additional namespace declarations from above. (It > may be required to add the startDocument() and endDocument() events.) > What's left is to make sure, that the XMLFilterImpl is used and not a > standard XMLReader. > > - Do not use the SchemaReader's parse(InputSource) method, but copy it. > (Obviously, you can omit the DTD part.) That gives you access to two > objects: The XSParser, and the SchemaSG. > - Create an instance of JAXBXsObjectFactoryImpl and overwrite the method > newXMLReader(). When invoked for the first time, return the XMLFilter > from above. Otherwise, return super.newXMLReader(). > - Make sure, that your object factory is used by invoking > XSParser.getData().setXsObjectFactory(). > > > > > #2: I can't get a mapping of which schema type/element (QName) was > > mapped to which java package/class. I need to to generate other code > > like Stub/Receiver outside of JaxMe. > > That should be easy by using the above instance of SchemaSG. > > > Jochen >
-- Davanum Srinivas : http://wso2.com/blogs/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
