• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdk6 Failed to extract complete Document from SoapBody

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We switched from java5 to java6, and also added some axis2 libraries: axis2-saaj-api-1.4.1.jar, axis2-saaj-1.4.1.jar, axiom-api-1.2.7.jar, axiom-dom-1.2.7.jar axiom-imp-1.2.7.jar.
The SoapBody looks like:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><GetEmployeeStatusRequest>
<EffectiveOn>2009-01-01</EffectiveOn>
<Filter>
<Companies>
<CompanyIdentifier>xyz</CompanyIdentifier>
</Companies>
</Filter>
</GetEmployeeStatusRequest></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

But the Document extracted from SoapBody only contains the first layer child:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><GetEmployeeStatusRequest/>


The code I'm using to get the document is below:
Document oDoc = oSoapBody.extractContentAsDocument();
DOMSource oDomSource = new DOMSource(oDoc);
StringWriter oStringWriter = new StringWriter();
Result oStreamResult = new StreamResult(oStringWriter);
TransformerFactory oFactory = TransformerFactory.newInstance();
Transformer oTransformer = oFactory.newTransformer();
oTransformer.transform(oDomSource, oStreamResult);

String stBody = oStringWriter.toString();
System.out.println(stBody);

I'm using eclipse debugging mode to step in to see what's inside the SoapBody before it's extracted, and I could find all the other elements.

Could anyone here to help me out? Appreciate for any suggestions!!!

 
Summer liki
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any suggestions?
 
Summer liki
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's an issue of axiom-imp.jar. The implementation of getNodeValue() failed to get the subchildren. I switched to use the old saaj api by using the saaj's MessageFactory, then everything works fine.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing that information!
reply
    Bookmark Topic Watch Topic
  • New Topic