This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Services and the fly likes A problem with Attachment using saaj Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "A problem with Attachment using saaj " Watch "A problem with Attachment using saaj " New topic
Author

A problem with Attachment using saaj

mojo lai
Greenhorn

Joined: Sep 09, 2007
Posts: 19
I wrote a program(TrySend1) to test attachment with saaj


TrySend1 call the servlet(TryReceive1) and TryReceive1 return a

soap message with attachment to it .

but In TrySend1 program , it can't see any attachment at all .

why ???

(p.s.I am sure that I add the attachment to the soap message response. because msg.countAttachments() return 1 )

following is my code

TrySend1



TryReceive1


[ October 13, 2007: Message edited by: mojo lai ]
[ October 13, 2007: Message edited by: mojo lai ]
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
In cases like these it's useful to examine the SOAP that gets sent over the wire. Either a tool like tcpmon (comes with Axis) can show it, or you could save the server response to a file before sending it, and examine its contents.
mojo lai
Greenhorn

Joined: Sep 09, 2007
Posts: 19
I think I have examined the SOAP that gets sent over the wire

by using System.out.println(msg.countAttachments())

am I wrong ?? thank you.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
That just tells you that the SOAP stack thinks that there is an attachment. What you need to find out is whether there is an attachment in the SOAP that is sent.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: A problem with Attachment using saaj
 
It's not a secret anymore!