axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <>
Subject Re: [jira] [Commented] (AXIS2-3933) Axis2 kernel currently has a direct dependency on Commons HttpClient 3.1
Date Wed, 26 Oct 2011 15:12:00 GMT
Hi Andreas,

IMO the solution should be to reuse what ever the available lib for
this without getting any new dependencies or forking, I prefer to use
Axiom capabilities for this.

I already started work on this. I found there are two class in Axiom
involve with MIME writing named MultipartWriter and OMMultipartWriter.
I think OMMultipartWriter is easy to use for this scenario.

But I just modify AbstractMultipartWriterTest before I port any Axis2
stuff. It seems like Axiom does not write "Content-Disposition" header
with MIME part instead it write  "Content-ID"  ( I think XOP/MTOM and
SwA required this header).

Current MultipartFormDataFormatter write this header and will use in
the MultipartFormDataBuilder to process messages in server side. In
fact Commons Fileupload process this "Content-Disposition" header
within MultipartFormDataBuilder class.  At the moment Axis2 support to
invoke web service through the HTML forms based on same approach (
HTML forms set this header).

Is there any configuration option available to instruct Axiom to write
 "Content-Disposition" header ?  If not I believe we need to add this

This is modified test code i used in Axiom.

 private void test(String contentTransferEncoding) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MultipartWriter mpw = factory.createMultipartWriter(baos,
        OutputStream partOutputStream = mpw.writePart("text/plain;
charset=US-ASCII", "8bit", UIDGenerator.generateContentId());
        partOutputStream.write("Hello World".getBytes());
        partOutputStream = mpw.writePart("text/plain;
charset=US-ASCII", "8bit", UIDGenerator.generateContentId());
        partOutputStream.write("This is my message".getBytes());
        System.out.println(new String(baos.toByteArray()));

I have added both messages.

Thanks !

On Thu, Oct 13, 2011 at 4:03 AM, Andreas Veithen (Commented) (JIRA)
<> wrote:
>    [
> Andreas Veithen commented on AXIS2-3933:
> ----------------------------------------
> It should be noted that Axis2 has dependencies on two other libraries that provide MIME
multipart writing capabilities, namely Axiom and JavaMail. I'm not sure that the optimal solution
is to fork the code from Commons HttpClient to create yet another MIME multipart writer in
Axis2 (which is what AXIS2-3933_2.patch does).
> I think that Sagara correctly identified the key problem that prevented progress on this
issue, namely the lack of test coverage. If there are enough unit tests, then it is simple
to rewrite the code to reuse Axiom or JavaMail.
>> Axis2 kernel currently has a direct dependency on Commons HttpClient 3.1
>> ------------------------------------------------------------------------
>>                 Key: AXIS2-3933
>>                 URL:
>>             Project: Axis2
>>          Issue Type: Wish
>>          Components: kernel
>>    Affects Versions: nightly
>>            Reporter: Oleg Kalnichevski
>>            Assignee: Sagara Gunathunga
>>         Attachments: AXIS2-3933.patch, AXIS2-3933_2.patch, axis2-kernel.patch
>> (1) This seems conceptually wrong to me. The kernel ought not have any dependencies
on a transport specific libraries
>> (2) A more practical reason: it is just a matter of time HttpClient 3.1 will be superceded
by HttpClient 4.0 and support for commons HttpClient will be discontinued.
>> If there is an agreement this is indeed an issue, which should be resolved, I will
happily invest time looking into what it takes to decouple HttpClient from Axis2 kernel.
>> Oleg
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
> For more information on JIRA, see:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Sagara Gunathunga

Blog      -
Web      -
LinkedIn -

View raw message