• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Soap & attachments: encoded or literal??

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep,

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic