File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAAJ Query

 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 2168
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what about:

Regards,
Frits
 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 2168
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server code



Code to publish this Server



Client code




Console Output from Client side code




Console output from Server code


 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic