or..

How can I create my own parser to return an InputStream for only the content
that is inside the MimeContent tag?

<xml-fragment xmlns:m="
http://schemas.microsoft.com/exchange/services/2006/messages";
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <m:ResponseMessages>
   <m:GetItemResponseMessage ResponseClass="Success">
     <m:ResponseCode>NoError</m:ResponseCode>
     <m:Items>
       <t:Message>
         <t:MimeContent CharacterSet="UTF-8">*RnJvbTogTGVlIF..... large mime
base64 encoded email....*.


Sample generated/modified code:

....

//execute the operation client
_operationClient.execute(true);

org.apache.axis2.context.MessageContext _returnMessageContext =
_operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
org.apache.axiom.soap.SOAPEnvelope _returnEnv =
_returnMessageContext.getEnvelope();
OMElement firstElement = _returnEnv.getBody().getFirstElement();

Map envelopeNameSpaces = getEnvelopeNamespaces(_returnEnv);

XMLStreamReader xsr = firstElement.getXMLStreamReader();

org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse(xsr,
GetItemResponseDocument.type, xmlOptions);  //Can I create my own?

Is implementing my own parser the way to go?

Reply via email to