Sory for not immidiate naswer but I was busy and couldn't find any time to
answer your question. But your mail is still waiting. I qout it below:
<Thanks for this, this is very interesting, as I am attempting the same
<thing with the Castor
<XML implementation (see previous post). The issue I have though is that
<Castor XML and to the
<best of my knowledge JAXB, will not (yet) accept SOAP encoded XML.
SOAP encoding support graphs, JAXB currently dosn'n support such a
functionality.
In any simply cases (trres not graphs) JAXB serialization should be enough
good, especially if you hardcode some additional informations in DTD, an
example:
This is xml document that represents businnes information:
<myFavoriteNumbers xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:enc="http://www.w3.org/2001/06/soap-encoding"
enc:arrayType="xs:int[2]" >
<number>3</number>
<number>4</number>
</myFavoriteNumbers>
We construct DTD with atributes xmlns:xs, xmlns:xs, enc:arrayType with
FIXED values like below:
<!DOCTYPE myFavouriteNumbers (number)* >
<!ATTLIST myFavouriteNumbers
xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
xmlns:enc CDATA #FIXED "http://www.w3.org/2001/06/soap-encoding"
enc:arrayType CDATA #FIXED "xs:int[]" >
<!ELEMENT number (#PCDATA)>
Then we generate MyFavouriteNumbers.java class (as array storage can use
Collection class) and any instance chould generate proper "business xml
data".
<As such in my SOAP requests, I am using document literal encoding. Do you
<also required this,
No, I configuere proper SOAP paltform and then server and client knows how
automatically to convert instances to XML and XML to instance.
On server side this configuration is done by DeploymentDescriptor.xml , on
client side by proper sequence of Apache SOAP method invocations.
<for JAXB and your serialiser to work properly? Do you have a sample
<request I can look at?
Attached, last time it was attached too.
<Also are you using an RPC style method signature in your implementation
<class?
Such an issue is solved on Apache SOAP level, any serializer is used only
for serialization anddeserialization RPC parameters and resutlt.
<Also my document literal SOAP requests (from a .Net C# client) don't
<carry
<any encodingStyle
<attribute. Yet in order to get my serialiser invoked I need to specify a
<SOAP encoding in the
<deployment descriptor? I noticed you also have this, so although my
<current solution works,
<the encodingStyle issue is a little strange to me?
My serializer dosn't define any new new encoding style, its only, like any
serializer a "plugin" into Apche SOAP environment and extend standard
abilities.
As mentioned above, by using fixed attributes you can force defining new
encoding roule, it could be probably usefull while cooperating with any
non Apache environment when our private serializer is not implemented, and
we try to force on peer side proper encoding procedure.
Probably I dosn't undestand enoaugh good some things, please correct me if
something isn't ok.
Radek Wisniewski
www.datenknecht.de
On Fri, 17 Aug 2001, Andrew Fawcett wrote:
> Hi,
>
> Not sure if you've read my reply to your post on the Apache SOAP mailing
> list... If not, I'd appreciate it very much if you could give me any
> thoughts on my reply and/or additional sample files on how you've configured
> your implementation with JAXB and Apache SOAP 2.2. My main question is, does
> it work with document literal encoding when the 'encodingStyle' attribute is
> absent?
>
> Thanks.
>
> Andy Fawcett.
>
>
> -----Original Message-----
> From: Andrew Fawcett [mailto:[EMAIL PROTECTED]]
> Sent: 16 August 2001 12:46
> To: '[EMAIL PROTECTED]'
> Subject: RE: XML Conversion...
>
>
>
> Radek,
>
> Thanks for this, this is very interesting, as I am attempting the same thing
> with the Castor XML implementation (see previous post). The issue I have
> though is that Castor XML and to the best of my knowledge JAXB, will not
> (yet) accept SOAP encoded XML.
>
> As such in my SOAP requests, I am using document literal encoding. Do you
> also required this, for JAXB and your serialiser to work properly? Do you
> have a sample request I can look at? Also are you using an RPC style method
> signature in your implementation class?
>
> Also my document literal SOAP requests (from a .Net C# client) don't carry
> any encodingStyle attribute. Yet in order to get my serialiser invoked I
> need to specify a SOAP encoding in the deployment descriptor? I noticed you
> also have this, so although my current solution works, the encodingStyle
> issue is a little strange to me?
>
> Any thoughts?
>
> Thanks.
>
> <soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> " xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance> " xmlns:xsd="
> http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> ">
>
> <soap:Body>
> <PurchaseProduct xmlns=" http://www.sprokets.com/sales
> <http://www.sprokets.com/sales> ">
> <Product>
> <Name>Widget (Small)</Name>
> <Code>XYZ100</Code>
> <Location>AB12</Location>
> </Product>
> </PurchaseProduct>
> </soap:Body>
> </soap:Envelope>
>
> -----Original Message-----
> From: Radek Wisniewski [ mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> ]
> Sent: 16 August 2001 12:21
> To: [EMAIL PROTECTED]
> Subject: Re: XML Conversion...
>
>
> I'v send already JAXB serializer, very beta version, probably to soap-dev
> list.
> Resending now again to soap-user.
>
>
> Radek Wisniewski
>
> On Thu, 16 Aug 2001, Balaji Iyer wrote:
>
> > Hi,
> > Has anyone has had a look at the AddressBook demo in Apache Soap.
> > Incase you have seen that, can someone throw more light with respect to
> > generating xml feeds from a vector of java objects. The AddressBook demo
> > has a SOAP Client (GetAllListings.java) which uses
> >
> > call.setMethodName("getAllListings");
> > call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> >
> > getAllListings method in the AddressBook Class does just the
> > generation of a DOM-TREE !! (Eeeks! !! )
> >
> > In my project usage...
> > For eg. Say I have a method returning a Hashtable of
> > MailInformationObjects. What should I do to convert this Hashtable into
> > XML using Apache-SOAP.
> > Solutions I propose ... (a) and (b) ... (a) is straight forward but
> > going to be messy. (b) needs to have the configuration set up well
> >
> > (a) Use something like an Element Generator like in the AddressBook
> > sample (part of code pasted)
> > public Element getAllListings()
> > {
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element bookEl = doc.createElement("AddressBook");
> >
> > bookEl.appendChild(doc.createTextNode("\n"));
> >
> > for (Enumeration keys = name2AddressTable.keys();
> > keys.hasMoreElements();)
> > {
> > String name = (String)keys.nextElement();
> > Address address = (Address)name2AddressTable.get(name);
> > Element listingEl = doc.createElement("Listing");
> > -----
> > ----
> > ----
> > -------
> > ---------
> > listingEl.appendChild(addressEl);
> > listingEl.appendChild(doc.createTextNode("\n "));
> > bookEl.appendChild(doc.createTextNode(" "));
> > bookEl.appendChild(listingEl);
> > bookEl.appendChild(doc.createTextNode("\n"));
> > }
> >
> > return bookEl;
> > }
> >
> > Then use this Element in the SOAP Client Program and switch to XML
> > Literal encoding and use the XML feed ?
> >
> > (b) Use some mapping facilities of APACHE-SOAP , (WHICH I AM NOT AWARE
> > OF )
> > or use either JAXB1.0 or Castor 0.9.2 (I have used before) to
> > generate xml feeds from my Hashtable of MailInformation Objects!!
> >
> > Has anyone ecountered this situation earlier... ? ? I am sure someone
> > can propose more solutions?
> > Pls, throw more light and roll this discussion.
> >
> > Regards,
> > Balaji Iyer
> >
> >
> > -----Original Message-----
> > From: Evyatar Shoresh [ mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> ]
> > Sent: Thursday, August 16, 2001 3:51 PM
> > To: [EMAIL PROTECTED]
> > Subject: xml to bean convertition.
> >
> >
> > Hi,
> > I'm having a client-server aplication using soap as my messaging, my aim
> > is to send a xml document from the client that will be transfered as an
> > object ( pre-defined in a deployment descriptor ) to the method in the
> > server as a parameter.
> >
> > My problem is that no matter which descriptor i use the server takes my
> > xml as is and transfers it to the method as an Element object.
> >
> > Do you have any sample showing such a scenario?
> >
> > Thanx alot.
> >
>
>
JAXBSerializer.tgz