问题描述
webservice返回base64Binary的字符串axis自动生成的客户端使用DataHandler接收如何获取内容?正常应该是返回给我的base64加密字符串,我现在获取出来的都是乱码源码org.apache.axiom.util.stax.XMLStreamReaderUtils.getDataHandlerFromElement(reader)难道是因为使用了Base64DecodingOutputStreamWriter导致的?publicstaticDataHandlergetDataHandlerFromElement(XMLStreamReaderreader)throwsXMLStreamException{WritableBlobblob;Writerout;intevent=reader.next();if(event==2)returnnewDataHandler(newEmptyDataSource("application/octet-stream"));if(event!=4)thrownewXMLStreamException("ExpectedaCHARACTERevent");DataHandlerReaderdhr=getDataHandlerReader(reader);if(dhr!=null&&dhr.isBinary()){DataHandlerdh=dhr.getDataHandler();reader.next();returndh;}blob=newMemoryBlob();out=newBase64DecodingOutputStreamWriter(blob.getOutputStream());breakMISSING_BLOCK_LABEL_101;ex;thrownewXMLStreamException("Errorduringbase64decoding",ex);writeTextTo(reader,out);IOExceptionex;label0:doswitch(reader.next()){case4://'04'writeTextTo(reader,out);break;default:thrownewXMLStreamException("ExpectedaCHARACTERevent");case2://'02'out.close();breaklabel0;}while(true);returnnewDataHandler(newBlobDataSource(blob,"application/octet-string"));}
解决方案
解决方案二:
坐等啊