将文件附加到XML文件

时间:2014-04-29 09:37:26

标签: java xml web-services jaxb

我有一个XML文件,我使用JAXB在Java中解析然后我使用java对象来调用Web服务。现在我需要将文件附加到此XML文件。

我知道可以使用SoapUI附加文件,但我需要在java中使用它。

我尝试以这种方式包含它(在java中arg0将是bytes[]):

<!DOCTYPE doc [
<!ENTITY otherFile SYSTEM "test1Response.xml">]>
...
<urn:attachment>
    <urn:arg0>&otherFile;</urn:arg0>
    <urn:fileName>test1Response.xml</urn:fileName>
    <urn:typePJ>xml</urn:typePJ>
    <urn:comments>comments</urn:comments>
</urn:attachment> 

但它不起作用。还有其他建议吗?

0 个答案:

没有答案
相关问题