Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jdk6 Failed to extract complete Document from SoapBody  RSS feed

 
Summer liki
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Any suggestions?
 
Summer liki
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing that information!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!