|
List Info
Thread: XML <=> JAVA in real time
|
|
| XML <=> JAVA in real time |
  United States |
2007-10-07 16:46:17 |
Hello.
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.
--
View this message in context: http://www.nabble.com/XML-%3C%3D%3
E-JAVA-in-real-time-tf4584808.html#a13087600
Sent from the Xml Beans - User mailing list archive at
Nabble.com.
------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribe xmlbeans.apache.org
For additional commands, e-mail: user-help xmlbeans.apache.org
|
|
| Re: XML <=> JAVA in real time |

|
2007-10-07 23:41:01 |
|
Hi, 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 googlemail.com">michal.malczewski googlemail.com> wrote:
Hello. 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. -- View this message in context: http://www.nabble.com/XML-%3C%3D%3E-JAVA-in-real-time-tf4584808.html#a13087600
Sent from the Xml Beans - User mailing list archive at Nabble.com.
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe xmlbeans.apache.org">
user-unsubscribe xmlbeans.apache.org For additional commands, e-mail: user-help xmlbeans.apache.org">user-help xmlbeans.apache.org
|
| Re: XML <=> JAVA in real time |
  United States |
2007-10-08 17:12:41 |
Srinath C wrote:
>
> Hi,
> 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.
>
Thanks 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/XmlBeans
Faq#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
--
View this message in context: http://www.nabble.com/XML-%3C%3D%3
E-JAVA-in-real-time-tf4584808.html#a13105929
Sent from the Xml Beans - User mailing list archive at
Nabble.com.
------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribe xmlbeans.apache.org
For additional commands, e-mail: user-help xmlbeans.apache.org
|
|
[1-3]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|