Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JavaBeans generated from XML in WSAD

147 views
Skip to first unread message

Byron Gehman

unread,
May 24, 2002, 10:27:50 AM5/24/02
to
Product: IBM WSAD-IE v 4.1.0 build 0222

Hello,

Could someone point me to the javadoc for the
com.ibm.etools.xmlschema.beans package. WSAD-IE generates javaBeans from
XSD that extend classes in that package and I need to see the doc.

Specific questions:
1.) The Factory class generates javaBeans, but you can't call save on
the javaBean to save the XML, you must call save on the Factory that
generated the bean. How does the factory know which javaBean to save to
XML? or does it do all of them that the Factory created?

2.) JavaBeans that extend ComplexType have public constructors, but if
you construct the Bean using the constructor, calling setX() results in a
NullPointerException everytime. Beans generated using the factory do not
have this problem. How is the factory generating the beans differently?

3.) When generating a webservice from a binding-wsdl, the JavaBeans
(mappings) generated in that wizard extend
com.ibm.etools.xsd.bean.runtime.AnyType....I would like to have the javaDoc
for that package also. The AnyType Beans do not have the
NullPointerException problem like the ComplexType beans, but the AnyType
beans do not have any way of reading/writing XML documents.

I would like to have beans that are easy to use as the AnyType beans,
but also capable of reading/writing XML.

Any and all help is appreciated!

Byron Gehman

Byron Gehman

unread,
May 29, 2002, 2:18:48 PM5/29/02
to
I have found that the JavaBeans generated by WSAD that extend the classes in
com.ibm.etools.xmlschema.beans are not suitable for
serialization/deserialization by the BeanSerializer and NS_URI_SOAP_ENC
encoding (defaults). It appears that the BeanSerializer gives up when it
calls the getXMLElement() method defined in
com.ibm.etools.xmlschema.beans.BaseType with an IllegalArgumentException:
"No Serializer found to serialize a 'org.w3c.dom.Element' using encoding
style 'http://schemas.xmlsoap.org/soap/encoding'".

The reason being, I think, is that the BeanSerializer is calling all the
get<whatever>(void) methods, and it sees the getXMLElement() method that
returns an org.w3c.dom.Element. The org.w3c.dom.Element is really the
datastore for all the information in my bean, and is redundant to calling
the get<whatever>(void) methods. Is there a way to get these type of beans
serialized with the BeanSerializer class. If the method were called
exportXMLElement() I wouldn't be having this problem.

Any help would be appreciated. A work-around is to write conversion
methods, that convert the com.ibm.etools.xmlschema.beans.ComplexType to the
com.ibm.etools.xsd.bean.runtime.AnyType beans which are suitable for
serialization/deserialization by the BeanSerializer.

Byron

"Byron Gehman" <bge...@us.ibm.com> wrote in message
news:aclidi$11ta$1...@news.boulder.ibm.com...

Chris Brealey

unread,
May 30, 2002, 3:55:24 PM5/30/02
to
Byron,
try using the "Java beans for XML Schema" wizard under the New -> Web Services
category to generate the web service-friendly variety of Beans that extend
com.ibm.etools.xsd.bean.runtime.AnyType.
0 new messages