Martin -
have you tried executing xml-axis/java/test/saaj/TestAttachment.java in your
environment? The testMultipleAttachments method seems to execute similar code.
/Chris
---------- Original Message ----------------------------------
From: "BTInternet" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Mon, 28 Jul 2003 09:58:00 +0100
>I am trying to create a soap message with attachments and running into a
>problem I cannot figure out. Below is a fragment of code used to add an
>attachment to a SOAP message. It throws a nullPointer Exception in the
>createAttachmentPart method. Any ideas?
>
> URL report = new File(filePath).toURL();
> DataHandler dataHandler = new DataHandler(report);
> System.out.println(dataHandler.getContentType());
>// Exception thrown at this point
> AttachmentPart attachment =
>message.createAttachmentPart(dataHandler);
> System.out.println(attachment.getContentType());
> attachment.setContentId("report_id");
> message.addAttachmentPart(attachment);
>
>Thanks
>
>Martin
>
>
>