jayachandra wrote:

Hi guys!
Do anyone around have some familiarity with XML Beans and xsb files.
I have the Axis2 wsdl2java tool generating the following schema system
meta data files

schema
     |
     ----system
     |      |
     |      ----foo
     |           |
     |            ----TypeSystemHolder.class
     |           |
     |            ----echostring9d15doctype.xsb
     |           |
     |            ----echostring97a3elemtype.xsb
     |            ....(and some more)
     |
     ----javaname
            |
            ----mypackage
                  |
                  ----EchoStringDocument.xsb

What should I do in my test client program if I should instantiate a
schemaType of EchoStringDocument in the above given scenario.
Using the following line I'm able to instantiate schemaType of
echostring9d15doctype.xsb and other xsbs in that folder

SchemaType sType =
(SchemaType)schema.system.foo.TypeSystemHolder.typeSystem.resolveHandle("EchoStringDocument");

Since the TypeSystemHolder class is not available under
schema/javaname/mypackage, how can I instantiate a schema type of
EchoStringDocument.

I'm totally new to XML Beans, so any help or pointers can be of great help.
i have no idea how (what was input WSDL/XSD?) or what you generated but if you have XmlBeans generated classses then you can create java classss for xs:element by simply doing something like this:

EchoStringDocument inputMsg = EchoStringDocument.Factory.newInstance();
       ... field  = inputMsg.addNewWhateverField();

HTH,

alek

ps. if you need to find XmlBeans generated classes dynamically for given QName then you should use SchemaType AFAIK:

               SchemaTypeSystem schemaTypeSystem  = ...
               QName qn = ...;
               SchemaType typeEl = schemaTypeSystem.findDocumentType(qn);

http://marc.theaimsgroup.com/?l=xmlbeans-dev&m=109537770023934&w=2

--
The best way to predict the future is to invent it - Alan Kay

Reply via email to