Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

Jax-WS attachments puzzle

Thread view: 
mchristyuk - 10 Dec 2007 08:46 GMT
Hi everyone,

I was hoping somebody could shed some light on a puzzling issue I have
doing attachments with Jax-WS.

The scenario is that I send a file to a service as an attachment.. the
service processes the file.. then at a later date I call the service
again to get the processed file back.

I am using Java 6, Netbeans 6 and Sun App Server 9 (bundled with
Netbeans 6) as my platform.

Now my problem is that I can send attachments fine from the client to
the service.. however when ever I put an attachment on a response from
a service it never gets back to the client. The response arrives but
with no attachments.

When I send from the client to the service I get a context from a
BindingProvider, put in a DataHandler and add this to the context as
an OUTBOUND_MESSAGE_ATTACHMENTS type.. this arrives at the service and
I can get my attachments from the WebServiceContext object and they
are there as INBOUND_MESSAGE_ATTACHMENTS.

I thought that to send a file as an attachment back to the client I
would do a very similar thing.. except instead of using the
BindingProvider I just use the WebServiceContext. I go through exactly
the same process.. however my message received at the client has no
attachments.

I'm tearing my hair out over this one.. is there something silly I'm
missing? I've searched on Google high and low but all the posts I see
are about client to service.. not service to client..

I am getting no errors exceptions either..

Help!.. what am I doing wrong? Is the WebServiceContext only
applicable to incoming calls and therefore I need to create something
else for a response call?

Many Thanks

Mark Christy
mchristyuk - 10 Dec 2007 11:23 GMT
Just to follow up with some more information..

I put a monitor on the wire to see what the request and responses were
coming out of the client/service. The client request shows the
attachment however the server response has none.

Therefore I'm pretty confident its all going wrong at the service
end.. I'm putting my attachment DataHandlers into the current
WebServiceContext and sending my reply back.. they just don't seem to
be there..

Cheers

Mark
mchristyuk - 11 Dec 2007 10:48 GMT
Well for those interested in a solution I have it.. though it makes no
sense to me at all!

I created an empty SOAPHandler which does absolutely nothing..

However this made the service work perfectly in returning files as
attachments!.. removing the empty SOAPHandler stops the service
returning attachments..

Very confused.. but it works.. so I'm happy..

Mark


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.