This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes SOAP JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP JMS " Watch "SOAP JMS " New topic
Author

SOAP JMS

sivaprasad pasupulathi
Ranch Hand

Joined: Apr 21, 2009
Posts: 36
Hi,

I need to invoke a WS through soap/jms.I need to send the message over MQ and wait for response and read the message of the queue.I am running on jdk1.6 and used axis2 (ADB) to generate the client.I would like to know how to use the call back and connection pool operations.I have few questions like do i need to configure the mq on my server?,how do i need the connection?,how do i send the replyto queue name to the provider...etc.Can some one provide some insight and few examples.


Thanks
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Axis 2 support soap over jms. You can find this link useful. http://charithaka.blogspot.com/2008/10/soap-over-jms-with-axis2.html

I thinks axis 2 doesn't support soap over jms spec though.


SCJP 1.5(97%) My Blog
sivaprasad pasupulathi
Ranch Hand

Joined: Apr 21, 2009
Posts: 36
Thanks for your reply tripathi.


But What i am looking for is a callback approach,where the handle comes to the client and waits for the repsponse.I am looking for AXIS2 ADB approach..etc.
If you have any information on these,could you please let me know.


Thanks
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
AXIS ADB is used for data binding i.e mapping schema elements to java programming model. It has noting to do with soap over JMS. From your post I think you want to send request to jms queue and get the response back. You can use replyto property if you explicitly want to mention the response queue. Otherwise don't mention any reply to property and axis will create a temp queue for response and read response form there. Some time back I have written below mention code, but that is synchronous client i.e client will wait for the response as opposed to call back and pooling techniques which are inherently asynchronous. Try this and with little modification you can convert it to asynchronous. But if you still find it difficult let me know.


-SHIV
sivaprasad pasupulathi
Ranch Hand

Joined: Apr 21, 2009
Posts: 36
Hi Shiv,

I tried few options and either of these did not work.Could you please let me know the missing pieces.

Method 1 :

I generated stubs through Axis2 wsdl2Java and after importing them,i found that the generated callback Handler did not contain all the method which other classes were refering to.I used Axis2 1.4.1 and i tried with 1.3 as well.Both had the same issue.The command which i used to generate the stub is

wsdl2Java -uri "C:\wsdl\abc" -d adb -u


Method 2:

I tried to check with the sample code which you have provided.But i Got

exception in thread "main" org.apache.axis2.Axisfault :Transport out has not been set .


here is the change which i added to the existing one



The other question i have here is,if you are to call a service,you need to know the implementations (methods in the service) to invoke it.Don't we need to generate stubs in this approach.

Thanks for your help.

shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Hi Siva,

Regarding method 1,

If you want to generate stubs with asynchronous call you have to use -a option. I tried following command with axis 1.5.1 and was able to make asynchronous call.



If you notice I am using -t option which generate test cases as well.

Regarding you second question:

To not get transport out not found error you have to allow JMS transport in the axis2.xml file in the jar which is being used by your client code at runtime.

Regarding not using generated stub, there are couple of ways to call remote service. You can call a webservice directly using axis clent api without using stubs. But in this case you have to do data binding your self(generation of envelope etc.). If you see under the hood generated stubs do the same thing for you i.e use the axis client api to call remote service.

-shiv


André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
SOAP is for web service?


thanks in advance!
André AS
Brazil
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SOAP JMS
 
Similar Threads
SOAPFault
Help to create MQ message in java
MQ series
SOAP.... Help pls
SOAP over JMS