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.
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.
Joined: Aug 26, 2008
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.
Joined: Apr 21, 2009
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
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.
Joined: Aug 26, 2008
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.