[ https://issues.apache.org/jira/browse/WODEN-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531640 ]
John Kaputin commented on WODEN-65: ----------------------------------- Good work Sagara. Looks like you've made some great progress. I'll take a closer look at the extensions serialization and see if I have any comments to add. In the meantime, here's some feedback on your latest code contribution. 2 naming styles are used for the DOMWSDLWriter print methods; printXXXXs and printXXXXElements (e.g. printBindings and print BindingOperationElements). Could you use just one naming convention here. For example, either printBindings and printBindingOperations (the WSDL4J style) or printBindingElements and printBindingOperationElements. If you choose the first style, the documentation print method should be called printDocumentation (without an 's' on the end). The printDocumentations method in DOMWSDLWriter uses a Java 5 JAXP API method. It calls the org.w3c.dom.Node.getTextContent() method. Woden currently pre-reqs Java 1.42, so this method will not compile under Java 1.42. Can you use a similar approach to WSDL4J, which is also coded to Java 1.4 - see how WSDL4J WSLDWriterImpl.printDocumentation calls DOM2Writer.serializeAsXml which further down the call path uses the Node.getNodeValue() method. I have 3 observations after running your latest code against your original test-prefix.wsdl file: (1) The attribute xsi:schemaLocation is not being printed out. I'm not sure yet if this a problem with the writer code or if it's not being parsed correctly from the WSDL by the reader code. (2) When printing the TypesElement, the output includes a schema import for the W3C schema for XML Schema: <xs:import namespace="http://www.w3.org/2001/XMLSchema" location="file:/C:/workspace/woden/woden65/bin/org/apache/woden/resolver/XMLSchema.xsd" /> This schema import is added by Woden to get the built-in XML schema data types into the Woden object model. We have a JIRA open to come up with a better solution. In the meantime, your writer code should just ignore the schema import if it's for the W3C schema for XML Schema (i.e. namespace http://www.w3.org/2001/XMLSchema). (3) There are some unexpected namespace declarations being printed out for the xs:schema element within the wsdl:types element. They are xmlns:name, xmlns:wsdl, xmlns:soap, xmlns:xs (these are declared in the wsdl:description element, not the inlined xs:schema element) Could you please create some JUnit test classes to add to the Woden test suite in the /test folder. We will need a WSDLWriterTest class in the org.apache.woden package that contains a test method for each method on the WSDLWriter interface (so, this class tests each writer API method). I've just noticed that the /test/org.apache.woden.WSDLReaderTest class does not have a specific test method for every method on the WSDLReader interface so that's not a good example to follow! Take a look at something like /test/org.apache.woden.wsdl20.EndpointTest instead for a better example. You could try this slighty different programming model from the code in sample1.java: Description descComp = re.readWSDL(....wsdluri....); DescriptionElement descElem=descComp.toElement(); wr.writeWSDL(descElem,System.out); ....or just.... wr.writeWSDL(descComp.toElement(), System.out); Thanks again for your contributions so far. > Woden elements must have serialize methods > ------------------------------------------ > > Key: WODEN-65 > URL: https://issues.apache.org/jira/browse/WODEN-65 > Project: Woden > Issue Type: Improvement > Components: Parser > Reporter: Eran Chinthaka > Assignee: Sagara Gunathunga > Attachments: BaseWSDLWriter.java.txt, DOMWSDLWriter.java.txt, > OMWSDLWriter.java.txt, sample1.java, test-prefix.wsdl, test.wsdl, > WriterFeatures.java.txt, WSDLWriter.java.txt > > > When we load a WSDL in to Woden object model, there is no way to serialize > the object model in to an output stream. This is very much useful when some > one wants to make sure Woden can properly spit out what it has read. > And there is a requirement from Axis2 also to make Woden element serializable > to cater for ?wsdl2 requests. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]