axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hu, Mary - ITG" <Mary...@jpmorgan.com>
Subject RE: How to convert ADBBean object into JDOM object
Date Wed, 19 Aug 2009 14:37:44 GMT
Andreas,

Since I don't use axis2 - 1.5, I figured out a different approach:

OMElement  omElement = adbBean.getOMElement(ADBBean.MY_QNAME,
MAbstractFactory.getOMFactory());					
String omStr = omElement.toString();
			
SAXBuilder builder = new SAXBuilder();
StringReader sr = new StringReader(omStr);
Document doc = builder.build(new java.io.BufferedReader(sr));	


Mary Hu

-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com] 
Sent: Monday, July 27, 2009 2:20 PM
To: axis-user@ws.apache.org
Subject: Re: How to convert ADBBean object into JDOM object

Mary,

Did you have a chance to test the code? I would like to hear if it
worked or not.

Andreas

On Wed, Jul 22, 2009 at 19:55, Andreas
Veithen<andreas.veithen@gmail.com> wrote:
> Mary,
>
> You can try something like this:
>
> MyBean bean = ...
> Transformer transformer =
TransformerFactory.newInstance().newTransformer();
> OMFactory factory = OMAbstractFactory.getOMFactory();
> OMSource in = new OMSource(bean.getOMElement(MyBean.MY_QNAME,
factory));
> JDOMResult out = new JDOMResult();
> transformer.transform(in, out);
> Element element = (Element)out.getResult().get(0);
>
> Note that this assumes you have Axiom 1.2.8 (which comes with Axis2
> 1.5). Also note that I didn't test the code, so please let us know if
> it works.
>
> Andreas
>
>
> On Wed, Jul 22, 2009 at 19:03, Hu, Mary - ITG<Mary.Hu@jpmorgan.com>
wrote:
>> Hi,
>>
>> I have ADBBean objected generated in axis2. Now I need convert this
>> object into org.jdom.Element object for business processing. Can
someone
>> tell me how I can do it?
>>
>>
>> Thanks,
>> Mary Hu
>>
>>
>>
>>
>> This email is confidential and subject to important disclaimers and
>> conditions including on offers for the purchase or sale of
>> securities, accuracy and completeness of information, viruses,
>> confidentiality, legal privilege, and legal entity disclaimers,
>> available at http://www.jpmorgan.com/pages/disclosures/email.
>>
>

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

Mime
View raw message