Package org.apache.axis2.attachments

Examples of org.apache.axis2.attachments.ByteArrayDataSource


        String contentType = org.apache.axis2.om.impl.MIMEOutputUtils
        .getContentTypeForMime(boundary, omOutput.getRootContentId(),
            omOutput.getCharSetEncoding(),SOAP12Constants.SOAP_12_CONTENT_TYPE);
        DataHandler dataHandler;
        dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        OMText textData = factory.createText(dataHandler, true);
        assertNotNull(textData.getContentID());

        DataHandler dataHandler2 = new DataHandler(
                "Apache Software Foundation", "text/plain");
View Full Code Here


        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
        OMElement rpcWrapEle = fac.createOMElement("echoMTOMtoBase64", omNs);
        OMElement data = fac.createOMElement("data", omNs);
        byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
                98};
        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        expectedTextData = new OMTextImpl(dataHandler, true);
        data.addChild(expectedTextData);
        rpcWrapEle.addChild(data);
        return rpcWrapEle;
    }
View Full Code Here

       OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
       OMElement rpcWrapEle = fac.createOMElement("echoMTOMtoBase64",omNs);
     OMElement data = fac.createOMElement("data", omNs);
     byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
        98 };
     DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
     OMTextImpl textData = new OMTextImpl(dataHandler, true);
     data.addChild(textData);
         rpcWrapEle.addChild(data);
     return rpcWrapEle;
    }
View Full Code Here

    OMElement data = fac.createOMElement("data", omNs);
    byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
        98 };
    for (int i = 0; i <4; i++) {
      OMElement subData = fac.createOMElement("subData", omNs);
      DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(
          byteArray));
      OMText textData = new OMTextImpl(dataHandler, true);
      //OMText textData = new OMTextImpl("Thilina Gunarathne");
      subData.addChild(textData);
      data.addChild(subData);
View Full Code Here

    /*
     * this should return a DataHandler containing the binary data
     * reperesented by the Base64 strings stored in OMText
     */
    if (value != null) {
      ByteArrayDataSource dataSource;
      byte[] data = Base64.decode(value);
      if (mimeType != null) {
        dataSource = new ByteArrayDataSource(data, mimeType);
      } else {
        // Assumes type as application/octet-stream
        dataSource = new ByteArrayDataSource(data);
      }
      DataHandler dataHandler = new DataHandler(dataSource);
      return dataHandler;
    } else {
      if (dataHandler == null) {
View Full Code Here

    OMAttribute cType1 = new OMAttributeImpl("contentType", mime,
        "text/plain");
    text.addAttribute(cType1);
    byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
        98 };
    dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
    OMTextImpl textData = new OMTextImpl(dataHandler, false);

    envelope.addChild(body);
    body.addChild(data);
    data.addChild(text);
View Full Code Here

    ByteArrayOutputStream outStream;
    String boundary = "----TemporaryBoundary";

    String contentType = MIMEOutputUtils.getContentTypeForMime(boundary);
    DataHandler dataHandler;
    dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
    OMText textData = factory.createText(dataHandler, true);
   
    DataHandler dataHandler2 = new DataHandler(
        "Apache Software Foundation", "text/plain");
    OMText text = factory.createText(dataHandler2, true);
View Full Code Here

        /*
         * this should return a DataHandler containing the binary data
         * reperesented by the Base64 strings stored in OMText
         */
        if (value != null) {
            ByteArrayDataSource dataSource;
            byte[] data = Base64.decode(value);
            if (mimeType != null) {
                dataSource = new ByteArrayDataSource(data, mimeType);
            } else {
                // Assumes type as application/octet-stream
                dataSource = new ByteArrayDataSource(data);
            }
            return new DataHandler(dataSource);
        } else {

            if (dataHandler == null) {
View Full Code Here

        String contentType = org.apache.axis2.om.impl.MIMEOutputUtils
        .getContentTypeForMime(boundary, omOutput.getRootContentId(),
            omOutput.getCharSetEncoding(),SOAP12Constants.SOAP_12_CONTENT_TYPE);
        DataHandler dataHandler;
        dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        OMText textData = factory.createText(dataHandler, true);
        assertNotNull(textData.getContentID());

        DataHandler dataHandler2 = new DataHandler(
                "Apache Software Foundation", "text/plain");
View Full Code Here

        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
        OMElement rpcWrapEle = fac.createOMElement("echoMTOMtoBase64", omNs);
        OMElement data = fac.createOMElement("data", omNs);
        byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
                                      98};
        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        expectedTextData = new OMTextImpl(dataHandler, true);
        data.addChild(expectedTextData);
        rpcWrapEle.addChild(data);
        return rpcWrapEle;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.attachments.ByteArrayDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.