dev@jax-ws.java.net

Re: Stream-based attachment decoding

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Fri, 16 Dec 2005 16:01:11 -0800

Kohsuke Kawaguchi wrote:

> Vivek Pandey wrote:
>
>> Kohsuke,
>>
>> Just contentType in Decoder.decode(inputStream, contentType) may not
>> be sufficient.
>>
>> for example AttachmentStreamDecoder would need information about
>> other HTTP header parameters, such as Multipart/Related header
>> parameters, such as boundary and start. What we need here is
>> something like ContentType from JavaMail, that can give easy access
>> to the Mime parameters or the assumption here is that decode gets the
>> compelte stream that includes the HTTP headers?
>
>
> Hmm. Good point.
>
> We can't just give it the complete HTTP header stream, because the
> transport might not be HTTP. Perhaps we'd have to pass in a callback
> so that the decoder can access headers? (I guess the complete MIME
> headers need to be exposed to WebSericeContext anyway.)
>
I meant transport specific headers.

> So would it be something like:
>
> Decoder.decode(InputStream, Headers headers);
>
> ... where Headers is ...
>
> interface Headers {
> String getHeader(String headerName);
> String[] getHeaders(String headerName);
> ... a few other accessors ...
> }
>
> ?

This would work. We still need something to parse the MIME headers - one
way would be to use the java mail classes, such as for Content-Type
header use ContentType class or else we would need some utility to write
tokenizer for the mime parameters, which I think wouldnt be difficult.

-vivek.


>
>

-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.