You would be able to handle the case2 & 3 without much hassle.. In the case2 you have to explicitly set that the content is base64Binary. If not Axis2 will treat it as a normal string. You can do that either by using a schema which defines that the content of the "output" element is base64Binary or you can explicitly set that by setting the "setBinary(true);" in that text node.
Following modified code will handle both case 2 & 3..
OMElement outputElement ...
OMNode node = outputElement.getFirstOMChild();
if (node.getType() == OMNode.TEXT_NODE) {
OMText text = (OMText) node;
test.setBinary(true);
DataHandler dh = text.getDataHandler();
InputStream stream = dh.getDataSource().getInputStream();
}
Is dh valid for case (2) as well? or is dh=null in this case? I can test text.isOptimized() to see if base64 encoded? How can I know if its plain xml?
If the node is an instance of OMElement then it's a piece of xml.. You can also test for node.getType() == OMNode.ELEMENT_NODE...
Thanks,
~Thilina
Maybe text.isBinary ()...
Thanks for any suggestions.
Tony Dean
SAS Institute Inc.
919.531.6704
[EMAIL PROTECTED]
SAS... The Power to Know
http://www.sas.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
