You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Gayatri Irani <gi...@cimetrics.com> on 2002/03/20 20:10:21 UTC
Rescue me guys...
.have been banging my head against this for last 2 days.I had got it
working but something is messed up. I've looked up all the documentation
and samples and I think I'm doing it right; Please tell me what is it
that I'm doing something wrong.
I'm trying to pass attachments back and forth between a client and
server. The attachment from the client to the server just works fine.
But the other way round just wouldn't work. Here's the code snippet of
my SOAP service:
P.S.: "<?xml version=\"1.0\"
encoding=\"UTF-8\"?><PolledData/>" will be replaced by actual data
later, this is just for testing.
ByteArrayDataSource ds = new ByteArrayDataSource("<?xml version=\"1.0\"
encoding=\"UTF-8\"?><PolledData/>", "text/xml");
ds.setContentType("UTF-8");
DataHandler dh = new DataHandler(ds);
MimeBodyPart attachementFromServer = new MimeBodyPart();
attachementFromServer.setDataHandler(dh);
attachementFromServer.setContent(ds.getText(), "text/xml");
ctx.addBodyPart(attachementFromServer);
And ctx is SOAPContext that I get as a first parameter to my soap
service.
Guys, I'm suppose to be giving a demo on SOAP attachments at 4 and my
code breaks this afternoon. Any help would be really appreciated.
Thanks and hoping to hear from you all soon.
~Gayatri
(Am I sounding desperate or what?)
Re: Rescue me guys...
Posted by Aczel Csilla <ac...@freemail.hu>.
Hi!
Here is a link where you can study an exemple about SOAP attachments:
http://www-106.ibm.com/developerworks/webservices/library/ws-soapatt/
Good luck,
Csilla
Re: Rescue me guys...
Posted by Aczel Csilla <ac...@freemail.hu>.
Hi!
Here is a link where you can study an exemple about SOAP attachments:
http://www-106.ibm.com/developerworks/webservices/library/ws-soapatt/
Good luck,
Csilla