I don't think that you can use the
SerializationContext independant of a SOAP
MessageContext.� The default JAX-RPC type mapping of
complex objects, as implemented by the BeanSerializer
requires the ability to have the context call back to
the registry to find other serializers (for primitives
for example).� I'm not saying that it is impossible to
extract the entire type mapping framework for external
use.� But it seems silly considering that you won't be
able to have custom mappings and will probably end up
doing some serious code modifications in order to
create a couple of pivot points on either side of the
type mapping handlers.
�
I'm not totally sure what it is that you�are trying to
do, but it looks like what you want is just a
marshaller ala Castor, XMLBeans, JiBX, JAXB, etc.��
Then, if you like what the marshaller does, write some
JAX-RPC serialization wrappers for it and plug it into
the TypeMappingRegistry with your WSDD so that your
XML and JavaBeans are consistent across your web
services and J2EE enterprise.
�
Cheers.
Steve Maring


Christoph Gaffga <[EMAIL PROTECTED]> wrote:Hi,
I have a very simple test Bean, I want to serialize to
System.out. Is thos
possible?

I tried it like this:

QName qname = new QName("TestXMLSerializerQName");
AttributesImpl attr = new AttributesImpl();
PrintWriter writer = new
java.io.PrintWriter(System.out);

SerializationContextImpl ctx = new
SerializationContextImpl(writer);
ctx.setSendDecl(true);
ctx.setPretty(true);


System.out.println("qname: " + qname.toString());
System.out.println("attr: " + attr.toString());
System.out.println("ctx: " + ctx.toString());

ctx.serialize(qname, attr, new Integer(22));
ctx.serialize(qname, attr, this);

writer.close();

I get


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>22

without the "ctx.serialize(qname, attr, this);"-line.
Otherwise I get:

java.io.IOException: No serializer found for class
com.triplemind.samples.TestXMLSerializer in registry
[EMAIL PROTECTED]

What to do to avaid this exception?

Regards
Christoph

P.S.: Didn't found anything on the list, perheaps I
missed it.





__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to