|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
XML <=> JAVA in real timeHello.
Perhaps my question is little bit newbie, but so far I couldn't find any answer... Short background: I'm going to write some kind of WebService client. The trick is, that during developing I do not know the strucrure of WebServices it will be dealing with. That's why I'm going to use Dynamic Invocation Interface here. I've found an interesting document with nice source code example (http://www.ibm.com/developerworks/webservices/library/ws-udax.html). It works fine for me, till the point concerning obtaining the parameter objects for invocation. The wsdl I'm given contains nested schemas (*.xsd) imports that describe an complex object. I do have problems with obtaining it, and thus creating an input form for the user. Acctual question: Does XmlBeans provide a functionality to parse xsd files that describes complex objects in an dynamic way? I'm not interested with class generation and compilation - I just want to get methods and types provided, then generate input form for the user and finaly, when user press submit button, I want to pass all those parameters to the WebService. I need to do this on the fly - perhaps there will be WebServices invoked only once, or subsequent invokations will differ a bit, so creating *.class files is not the way to reach my goal. Is my question clear enough? I'd really appreciate any hint. |
|
|
Re: XML <=> JAVA in real timeHi,
Yes it is possible. You can do something like this : File schemaFile; InputStream xsdFileStream = new FileInputStream(schemaFile); XmlOptions options = new XmlOptions(); options.setCompileDownloadUrls(); options.setEntityResolver(new MyEntityResolver(schemaFile.getParent())); SchemaTypeLoader stl = XmlBeans.loadXsd(new XmlObject[]{XmlObject.Factory.parse(xsdFileStream)}, options); Using this "stl" variable you can iterate the entire schema structure. Regards, Srinath/ On 10/8/07, YelloY <
michal.malczewski@...> wrote:
|
|
|
Re: XML <=> JAVA in real timeThanks for hint Sirnath! All those data structures used here are bit confusing for me, and I was playing with tem whole evening without any success. But finaly I've found a solution here: http://wiki.apache.org/xmlbeans/XmlBeansFaq#schemaPropertySchemaParticle After a short analysis, it seems like the code provided there is exactly what I was looking for! Once again thanks for good direction ;) Regards, YelloY |
| Free embeddable forum powered by Nabble | Forum Help |