[ 
https://issues.apache.org/jira/browse/AXIS-2658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Akitoshi Yoshida updated AXIS-2658:
-----------------------------------

    Attachment: OctetStreamDataSource.zip

> OctetStreamDataSource with an arbitrary content type
> ----------------------------------------------------
>
>                 Key: AXIS-2658
>                 URL: https://issues.apache.org/jira/browse/AXIS-2658
>             Project: Axis
>          Issue Type: Improvement
>          Components: Basic Architecture
>    Affects Versions: 1.4
>         Environment: JDK 1.4.2
> Windows XP
>            Reporter: Akitoshi Yoshida
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: OctetStreamDataSource.zip
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to