aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes SAAJ Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "SAAJ Query" Watch "SAAJ Query" New topic
Author

SAAJ Query

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

Hi

I am currently trying to write code to learn SAAJ.
I have written SAAJ Client code. My Client code creates an attachment and attach it to SOAP Request message.

Now I need to write SAAJ Server side code which extract this SOAP attachment and read it.
Please help me in writing this SAAJ Server side.

Thanks
Abhay Agarwal

Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

Just want to clarify more ..

First of all , I wrote a sample web service (let us say - multiply two numbers) . Then I published that code using Endpoint publisher.

After that, I wrote a SAAJ Client based code. And in that code, I wrote code to add Attachment.



Now how can I modify my Web Service implementation code to read SOAP attachment (attached in SAAj Client)?

Thanks
Abhay
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1734
    
  25

what about:

Regards,
Frits
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

Thanks Frits for the reply.

I did not knew we can directly have an input parameter of SOAPMessage type.


I shall definitely give it a try once I reaches home today.

Thanks
Abhay Agarwal
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

I got SAAJ example working end to end ... First client send attachment to Server. Server read the attachment and then send SOAP Response back to Client with another attachment. Client read the attachment from Server response.

~ abhay
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1734
    
  25

Abhay Agarwal wrote:I got SAAJ example working end to end ... First client send attachment to Server. Server read the attachment and then send SOAP Response back to Client with another attachment. Client read the attachment from Server response.

Great! It would be nice if you could post your code here.
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

Server code



Code to publish this Server



Client code




Console Output from Client side code




Console output from Server code


Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1220
    
    1

Hi Frits

I have posted my sample code here. It shall be helpful for any one having similiar query.

Btw, any specific reason for your request to post sample code here.

Thanks

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAAJ Query