axis中附件传输的问题
public DataHandler doServiceWithAtta(DataHandler dh) throws Exception {
logger.info("start");
FileHandler fh = new FileHandler();
fh.saveToFile("test", DateHandler.getRightDateFormat(DateHandler.getCurDate()), dh.getInputStream());
return dh;
}
根据如上代码,得到如下SOAPResponseMessage:
------=_Part_13_26757789.1133772587550
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
<--在这里,我想增加一行"Content-Length: 567"应该怎么修改我的代码?
Content-Id: <16ADD8FB4473E51D948D3FB10A1FC99C>
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:doServiceWithAttaResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://80.64.64.87:8080/ddoc/services/urn:ddoc"><doServiceWithAttaReturn href="cid:47599E8FD31D59002B5A741768C027FA" xsi:type="ns2:DataHandler" xmlns:ns2="urn:ddoc"/></ns1:doServiceWithAttaResponse></soapenv:Body></soapenv:Envelope>
------=_Part_13_26757789.1133772587550
Content-Type: application/binary
Content-Transfer-Encoding: binary
Content-Id: <47599E8FD31D59002B5A741768C027FA>
Attachment test file used in webservice.
------=_Part_13_26757789.1133772587550--