开发者

How to handle OMElement at serverside using MTOM-XOP concept?

Iam able to upload the image using MTOM-XOP by value concept.After that I tried to upload the same image using MTOM-XOP by Reference concept (XOP:Include).Iam able to write the Client program and generates the OMElement and passing this to Service also.But Here i strucked.I don't know how to handle the Referenced image and writting into the specified folder.I searched on google but found many samples and solutions for By value concept and SWA concept.Please give me guidance or sample program for handling the OMElement at server side?

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>

How to handle the href attribute and I found on solution that is

ArrayList<OMElement> xops =AttachmentUtils.findXopElements(element);
        if (xops != null && xops.size() > 0) {
            logFile("Found XOP:Include Elements\n");
        }
        QName hr开发者_StackOverflow社区ef = new QName("","href");
        Iterator<OMElement> itr = xops.iterator();
        while (itr.hasNext()) {
            OMElement xop = itr.next();
            String cid = xop.getAttributeValue(href);
            logFile("CID :"+cid+"\n");
        }

But this part not executed at server side.Please give us guidance on this.

Thanks.


Axiom represents XOP/MTOM attachments using OMText nodes for which isBinary() returns true. Such a node is created for each xop:Include element in the original message. In the case described here, one would retrieve the first child of the fd:fileContent element, cast it to an OMText and then call getDataHandler() on that object. The returned DataHandler gives access to the content of the attachment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜