You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ir...@dotech.com on 2004/09/07 20:33:57 UTC

JAXB and Axis 1.2


I am currently using the message style service (directly processing the XML
myself) and trying to use JAXB.  When I get to actually processing the XML, all
my elements that are parsed by JAXB are empty.  I used tcpmon and verfied the
values were ok, and also printed out the values directly in my method.  Help
please.  Has anyone set this up successfully?

I am using Axis 1.2 and the JAXB that comes with JWSDP 1.4

I have attached my PrintService class.

Re: JAXB and Axis 1.2

Posted by ir...@dotech.com.
I just added more debug in, via:

public void rental_agreement(SOAPEnvelope req, SOAPEnvelope resp){
	try { 
	SOAPBodyElement body = req.getFirstBody();
StreamResult result = new StreamResult( new FileOutputStream(
"agreement.raw.out" ) );
			DOMSource source = new DOMSource( body );
			Transformer transformer = TransformerFactory.newInstance().newTransformer();
			transformer.transform( source, result ); 
			this.context = JAXBContext.newInstance( "com.xerox.vanguard.rental" );
			this.unmarshaller = context.createUnmarshaller();
			RentalAgreement agreement = (RentalAgreement)(unmarshaller.unmarshal( source
));
			FileOutputStream file = new FileOutputStream( "agreement.out" );
			Marshaller marshaller = this.context.createMarshaller();
			marshaller.marshal( agreement, file );
			log.info( "Processing rental agreement number " + agreement.getRaNumber() );
		}catch( Exception e ){
			log.error( "Got exception on print request", e );
		}
	}

Quoting irv@dotech.com:

> 
> 
> I am currently using the message style service (directly processing the XML
> myself) and trying to use JAXB.  When I get to actually processing the XML,
> all
> my elements that are parsed by JAXB are empty.  I used tcpmon and verfied
> the
> values were ok, and also printed out the values directly in my method.  Help
> please.  Has anyone set this up successfully?
> 
> I am using Axis 1.2 and the JAXB that comes with JWSDP 1.4
> 
> I have attached my PrintService class.



Re: JAXB and Axis 1.2

Posted by ir...@dotech.com.
I just added more debug information in via:

SOAPBodyElement body = req.getFirstBody();
StreamResult result = 
   new StreamResult( new FileOutputStream( "agreement.raw.out" ) );
DOMSource source = new DOMSource( body );
Transformer transformer = TransformerFactory.newInstance().newTransformer();

And, the element names are all there, but the data contained in those elements
is missing.  So, I am very perplexed at this point.  tcpmon shows that the
values are all there, and if I manually walk the DOM tree from the body
element, the values are all there.  However, putting this transformer in, that
should just serialize the values, is causing all the text to be missing. 
Should I not be using the SOAPBodyElement directly like this?  It seems as
though the text is getting lost because I am trying to directly use this?

Irv

Quoting irv@dotech.com:

> 
> 
> I am currently using the message style service (directly processing the XML
> myself) and trying to use JAXB.  When I get to actually processing the XML,
> all
> my elements that are parsed by JAXB are empty.  I used tcpmon and verfied
> the
> values were ok, and also printed out the values directly in my method.  Help
> please.  Has anyone set this up successfully?
> 
> I am using Axis 1.2 and the JAXB that comes with JWSDP 1.4
> 
> I have attached my PrintService class.