我能够上传图像使用MTOM-XOP By value concept.After,我试图上传相同的图像使用MTOM-XOP by Reference概念(XOP:Include).Iam能够编写客户端程序并生成OMElement并将其传递到服务also.But这里我构造了。我不知道如何处理引用的图像和写入指定的文件夹。我在谷歌上搜索,但发现许多样本和解决方案,按值概念和SWA concept.Please给我指南或示例程序处理服务器端的OMElement?
OMElement:
<fd:upload xmlns:fd="http://mtom.sample.com"><fd:fileName>dog</fd:fileName><fd:fileType>jpg</fd:fileType><fd:fileContent><axis2ns1:Include xmlns:axis2ns1="http://www.w3.org/2004/08/xop/include" href="dc88fd5aa40a7cbdd01c18b97c1202008f2f09ebaf2cf2f3@apache.org" /></fd:fileContent></fd:upload>如何处理href属性和我找到的解决方案,即
ArrayList<OMElement> xops =AttachmentUtils.findXopElements(element);
if (xops != null && xops.size() > 0) {
logFile("Found XOP:Include Elements\n");
}
QName href = new QName("","href");
Iterator<OMElement> itr = xops.iterator();
while (itr.hasNext()) {
OMElement xop = itr.next();
String cid = xop.getAttributeValue(href);
logFile("CID :"+cid+"\n");
}但这部分不是在服务器side.Please上执行的,这为我们提供了指导。
谢谢。
发布于 2011-11-15 23:10:23
Axiom使用isBinary()返回true的OMText节点表示XOP/MTOM附件。这样的节点是为原始消息中的每个xop:Include元素创建的。在这里描述的情况下,将检索fd:fileContent元素的第一个子元素,将其强制转换为OMText,然后对该对象调用getDataHandler()。返回的DataHandler提供对附件内容的访问。
https://stackoverflow.com/questions/5391880
复制相似问题