wood burning stoves*
The moose likes Web Services and the fly likes SAAJ client & service example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "SAAJ client & service example" Watch "SAAJ client & service example" New topic
Author

SAAJ client & service example

Prasanna Wamanacharya
Ranch Hand

Joined: Apr 24, 2001
Posts: 143
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
Here's a SAAJ client that connects to one of the samples that ships with Axis2: http://faq.javaranch.com/java/WebServicesHowTo#saaj-client


Ping & DNS - my free Android networking tools app
Prasanna Wamanacharya
Ranch Hand

Joined: Apr 24, 2001
Posts: 143
Thanks for replying Ulf.

However, I also need the source code of a web service implementation which processes a SOAP attachment using SAAJ. Having both the client and service source code would be great as that would help me understand the end-to-end mechanism.

BTW, I'm using WAS 7.0 to host the service endpoint & the SOAP handler.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
The WebServicesFaq points to an article that shows SAAJ attachments in action.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAAJ client & service example
 
Similar Threads
Binary SOAP attachment using Websphere
is websphere 5.1 suport ws-policy and attachment with WSDL?
SAAJ client & service example
Enabling MTOM when using SAAJ
soap with attachment question ?