Paul Sandoz wrote:
> Hi,
>
> What client are you using? How are you sending the MIME multipart
> message?
>
> Can you present the code for the resource class and resource method
> that is consuming the mime body part that contains the binary document?
>
> Is it possible to do compare byte-per-byte compare tests of the source
> bytes and received bytes?
>
> Since you are sending binary documents as MIME body parts there is no
> specific reader/writer as you are just dealing with either byte[] or
> InputStream.
>
I would definitely suggest using one of these two approaches, so you
don't have to write a MessageBodyWriter of your own. The simplest
approach might be to open an InputStream to the bytes of your word
document, and use that stream as the "entity" for a body part. You'd
also want to set the media type for this body part to
"application/octet-stream".
> Paul.
Craig
>
> On Apr 29, 2009, at 10:51 AM, Vidhya MAHADEVAN wrote:
>
>>
>>
>> Hello,
>> I have a requirement to send a word doc file to a RESTful service built
>> using Jersey 1.0.3.
>> I am using jersey-multipart for this purpose.
>> The file is sent. But then, I have a problem with the file being
>> unreadable
>> although the number of bytes of the source and destination file are the
>> same.
>> This works well with txt or XML files though
>> I read some posts by Craig Mclanahan on custom MessageBodyWriters.
>> Would you have any samples for custom MessageBodyWriters that can handle
>> word doc, excel files, exe files ?
>>
>>
>> Appreciate any response,
>> Vidhya
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *************************************************************************
>>
>> This message and any attachments (the "message") are confidential,
>> intended solely for the addressee(s), and may contain legally
>> privileged information.
>> Any unauthorised use or dissemination is prohibited. E-mails are
>> susceptible to alteration.
>> Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
>> shall be liable for the message if altered, changed or
>> falsified.
>> ************
>> Ce message et toutes les pieces jointes (ci-apres le "message") sont
>> confidentiels et susceptibles de contenir des informations couvertes
>> par le secret professionnel.
>> Ce message est etabli a l'intention exclusive de ses destinataires.
>> Toute utilisation ou diffusion non autorisee est interdite.
>> Tout message electronique est susceptible d'alteration.
>> La SOCIETE GENERALE et ses filiales declinent toute responsabilite au
>> titre de ce message s'il a ete altere, deforme ou falsifie.
>> *************************************************************************
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>