• Post Reply Bookmark Topic Watch Topic
  • New Topic

SAAJ client & service example

 
Prasanna Wamanacharya
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've developed a SAAJ client which sends out a XML file as an attachment. I've verified that the file does get attached, by printing out the entire SOAP on the client-side.

However, the receiving service does not get the attachment. Also, it is returning a fault to the client.
Fault message:
The endpoint reference (EPR) for the Operation not found is http://localhost:9081/SAAJTesting/DataReceiverService and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.

On the client side, I tried setting the content type "text/xml". But the client throws an exception (SEVERE: SAAJ0540: Error during saving a multipart message). So, I have to set it to "text/plain".

On the service side, I'm using a Handler (which implements SOAPHandler<SOAPMessageContext>) to extract the attachment. The endpoint webmethod does no processing (as everything is done in the handler).

Was wondering if someone could point me to a simple SAAJ client & service example so that I could figure out what is going wrong here.

TIA
 
udaykumar maddigatla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are attaching some content to soap message, then content-type must be multipart/related.

if you want sample example on this, please search it on Netbean.org site.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!