users@jax-rpc.java.net

Re: Array in document-style SOAP binding

From: Oliver Jaun <olijaun_at_yahoo.com>
Date: Wed, 6 Oct 2004 07:20:59 -0700 (PDT)

Hello

When I create an attachment with content-type
application/octet-string and the
Content-Transfer-Encoding is set to base64 (using
setMimeHeader(...)) the attachment is automatically
convertet to base64 which is great. However the base64
encoded attachment has line breaks after 76 characters
or so. I think this is because the Base64EncoderStream
of the JavaMail-API is used. SMTP has a maximum
"linewidth". The encoding is fine for emails but the
problem is, that a newline is not part of the base64
encoding and it seems that gSOAP (C Soap
implementation) has problems decoding my
"Java"-Soap-Message. I would like to have a the
attachment encoded without newlines.

How is the base64 encoding done in the background?
How can I change it? I think it has something to do
with the activation framework. I've implemented my own
com.ascom.srv.file.OctetStreamDataContentHandler and
added it to the mailcap. However the class is never
loaded and the regular base64 encoding is used
instead... I don't see why... Here's my code (the
OctetStreamDataContentHandler has only some
System.out.printlns so I can see if it is loaded...
but it's not):

MailcapCommandMap cm = (MailcapCommandMap)
CommandMap.getDefaultCommandMap();
cm.addMailcap("application/octet-stream;;
x-java-content-handler=com.ascom.srv.file.OctetStreamDataContentHandler");
MessageContext mc =
ServletEndpointContext.getMessageContext();
AttachmentPart att =
MessageFactory.newInstance().createMessage()
.createAttachmentPart();
att.setMimeHeader("Content-Transfer-Encoding",
"base64");
att.setContentId("distributedFile");
FileInputStream fis = new
FileInputStream("/tmp/bla.tar");
InputStreamDataSource ids = new InputStreamDataSource(
fis, "application/octet-stream", "distributedFile");
DataHandler dh = new DataHandler(ids);
att.setDataHandler(dh);

Any ideas...hints? Thanks a lot in advance

Regards

Oliver Jaun


                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net