Dan:

As it so happens, that is exactly what I am doing. I'm using Apache Soap
(http://xml.apache.org/soap/) for java and am writing a set of ebXml SOAP
services.
The wierdness with ebXml is that the xml documents that contain your data
are not found in the SOAP body, they are found in Mime attachments.

ApacheSoap provides for a couple ways of mapping xml requests to java
objects. First, the deployment maps request uri's and method names to java
classes and method names. It also provides built-in support for marshalling
and unmarshalling of native data types, Strings and Collections. There is
also
support for something called 'Bean' serialization which provides limited
mapping capabilities. Beyond that you can use the 'LiteralXml' encoding
type to simply pass XML to your SOAP methods. Your soap methods
will need to accept a (DOM) Node as a parameter. I'm pretty sure that
apache-soap has some examples of how to do this.

Once your java method has an XML Node, you simply need to turn it
into an InputSource and pass this into Castors Unmarshall object/method.
You'll probably also need to make some mapping.xml entries so that
Castor will know how to map the input onto your Java classes.
Castor has some good examples on how this mapping is achieved.

Let me know if I can be of any further help.

Good Luck:

Tom Drake ([EMAIL PROTECTED])

----- Original Message -----
From: "Dan Schmierer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 5:20 PM
Subject: Re: [castor-dev] Using Castor to generate java objects at runtime
from an XSD instance


> Thanks for the replies, I think I was a little ambiguous about what I was
> trying to do. Ok, via SOAP I receive a string for the time being that
> contains XML that adheres to a particular xml schema definition. I would
> like to put this xml into an object at runtime, so that I may change the
> values of particular fields of that xml schema instance and then send it
> back to the sender. How would I use castor to accomplish this? The
> documentation is pretty low on examples.
>
> Cheers
>
> Dan Schmierer
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to