-
1. Re: Soap message creation with an attachment
prabhakar Nov 27, 2002 3:02 AM (in response to pvamstel)The msg.createAttachment() method takes a javax.activation.DataHandler object as a parameter. Try creating the pdf attachment as a dataHandler object.
-prabhakar -
2. Re: Soap message creation with an attachment
pvamstel Nov 28, 2002 1:41 AM (in response to pvamstel)Did not do the trick.
When i call addAttachmentPart with a newly created attachment. I get back a null pointer.
I've browsed the code of apache but i'm not sure what it is doing. Has anyone have a simple example of creating a new soap message with an attachent. -
3. Re: Soap message creation with an attachment
rgjawanda Nov 28, 2002 12:27 PM (in response to pvamstel)I am in the middle of trying to setup a Web Service using message based protocol. I want to send back the response with an attachment. I am having all kinds of problems.
I am using jboss3.0.4 and have axis 1.0 installed.
I am able to send and receive soap messages but attachments are a real real headache.
There seems to be many ways of doing it but I can't get one way to work.
I hope we can work together to resolve it somehow.
I can post code or whatever.
Ron -
4. Re: Soap message creation with an attachment
pvamstel Nov 28, 2002 2:34 PM (in response to pvamstel)Happy to hear i'm not the only one not understanding the attachment stuff.
What i'm doing does not involve a webservice. I just want to create a soap message with an attachment and then serialize the message to disk
If you want to mail me mail me to pvamstel@hotmail.com
grt Patrick -
5. Re: Soap message creation with an attachment
pvamstel Nov 29, 2002 3:22 AM (in response to pvamstel)Finnally
I found it.
You have to add activation.jar and mail.jar from the tomcat distribution in your classpath
hopes this helps for you as well -
6. Re: Soap message creation with an attachment
prabhakar Nov 29, 2002 7:04 AM (in response to pvamstel)yes. you are right. The datahandler class is in the JAF package.
-prabhakar -
7. Re: Soap message creation with an attachment
rgjawanda Nov 29, 2002 11:15 AM (in response to pvamstel)From my test cases I have determined that it is in fact a bug and that attachments don't work in version 3.0.4.
I added soap2.2 to my deploy directory. Compiled the samples and attachments work fine.
Here is what I did find out.
Axis works find RPC, MSG services except when you try
to get the Soap Envelope. At this point jboss (or Axis) seems to get confused and cannot locate several methods that actually exist. This happened for a select handfull of methods. I absolutely know that I am calling them correctly because they work with clients that are calling them from a DOS java mainline program. Just not within a servlet on the jboss system.
SOAP 2.2 does everything correctly and works just fine.
You can get at the message body, header, and add attachments. I know the behaviors are different in soap but at least it works.
Ron -
8. Re: Soap message creation with an attachment
didi Feb 17, 2003 2:02 PM (in response to pvamstel)this means the posted source code from above works? (if no: can you please post the working source code? tnx)