Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Soap & attachments: encoded or literal??

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I would like for a ws client to retrieve an image from a ws endpoint. I am totally confused as to how to what encoding style to choose as well as how to implement it.

Here is the code for the client:



Here is the code for the endpoint:



If I choose documentliteral it will not compile and give me the following error message:
**************
Attachment types are not supported in literal mode - Type: "javax.activation.DataHandler"
**************

If I choose nothing (which defaults to encoded in Netbeans) It does compile but when I test the operation, I get this from JBOss 4.0.4:



I use Netbeans 5.0 and JBoss 4.0.4.

Can anyone help?

Julien.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julien, can you post the wsdl and the service endpoint interface?
[ May 27, 2006: Message edited by: Jesus Angeles ]
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep,

 
Nikhil Goel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Julein ,

Have a look https://jax-rpc.dev.java.net/whitepaper/1.1.2/attachments-howto.html

This is exactly what you are looking for .

Hope it helps.

-nikhil
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Thanks for the tip. I had a look at the article and here is what I tried to do:

I use a handler in order to attach the image. Whether I attach the attachment from within the service implementation or a handler is the same. Here is my handleResponse method:



Then I try to recover the attachment in the client using pretty much the same way as in the article:



This always yields a nullpointerexception on the collection object.

Can anyone tell me why??

Thanks in advance,

Julien.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic