Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2658

OctetStreamDataSource with an arbitrary content type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.4
    • 1.4
    • Basic Architecture
    • None
    • JDK 1.4.2
      Windows XP

    Description

      We would like to have a message ( org.apache.axis.Message ) that we can serialize (i.e., using its writeTo(OutputStream) method) more than once.

      We noticed that when attachments are instantiated with the org.apache.axis.attachments.ManagedMemoryDataSource class, they will be removed after serialization in the writeContentToStream(java.io.OutputStream os) method of org.apache.axis.attachments.AttachmentsImpl class. When this message is serialized again, it results in an IOException (not thrown but logged) saying that the resource is deleted.

      If the org.apache.axis.attachments.OctetStreamDataSource class can be changed to take a variable content type, we can use this data source class to replace those attachments in a handler.

      This will look like:
      ...
      private String contentType;
      ...

      public OctetStreamDataSource(String name, OctetStream data)

      { this(name, CONTENT_TYPE, data); }

      public OctetStreamDataSource(String name, String contentType, OctetStream data)

      { this.name = name; this.contentType = contentType; this.data = data == null ? null : data.getBytes(); os = new ByteArrayOutputStream(); }

      // ctor

      ...
      public String getContentType()

      { return contentType; }

      // getContentType

      Attachments

        1. OctetStreamDataSource.zip
          0.9 kB
          Akitoshi Yoshida

        Activity

          People

            Unassigned Unassigned
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: