Affects Version/s: None
Fix Version/s: None
Environment:Win2K, JDK 1.4, SonicMQ 7.0
I've created full documented unit tests for the new JMS implementation based on JMSEchoRawXMLTest. It may be used to establish a base for discussions found in http://email@example.com/msg18552.html. At a starter point, it only addresses authenticated connection discussed in the user-list a couple of days ago.
I used in-only services. Therefore, messages are sent to the queue without waiting a response. When the message arrives at the queue, listener(at the server) retrieves and delegates it to the AxisEngine. Finally, echoOMElement () method is invoked.
I created two services: EchoXMLService and SecureEchoXMLService. First one is accessed through TEST_QUEUE and the second one is accessed through SECURE_TEST_QUEUE. To be able to access SECURE_TEST_QUEUE, username and password must be passed. These are different from the principal and the credentials defined either in JMS URL or axis2.xml. The principal and the credentials are needed to access initial context factory of the JMS server. We can retrieve connection factories by using these values. Whereas, if the security is enabled, the username and the password are needed to create connection by using the retrieved factory. The factory implicitly creates connections to the broker. Thus, when the security option of the broker is enabled, there will be a need for username and the password. That is what the new JMS implementation doesn't support.
There are two unit tests: test01EchoXMLOneWay () and test02SecureEchoXMLOneWay(). First one makes call to the EchoXMLService through TEST_QUEUE. And the second one makes call to the SecureEchoXMLService through SECURE_TEST_QUEUE.
If the original JMSConnectionFactory and JMSSender are used, test02SecureEchoXMLOneWay () test cannot be passed. I made an ugly hack to these files to show authenticated connection. You may look at the TODO lines of the mentioned files.
To much words, huh?
- I used SonicMQ as JMS provider.
- Created two brokers
- InsecureBroker (localhost:2507)
- No username and password requires to connect
- Created TEST_QUEUE under the broker
- SecureBroker (localhost:2508)
- To be able to connect to this broker Username=SecureBroker and Password=myPassword must be passed.
- Created SECURE_TEST_QUEUE under the broker
- Created two connection factories and JNDI entries for them
- Creates connections to InsecureBroker
- Creates connections to SecureBroker
- Created JNDI entries for the queues (TEST_QUEUE and SECURE_TEST_QUEUE)
Content of the Attached Package
- Unit test class (NewJMSEchoRawXMLTest)
- Security enabled JMSConnectionFactory and JMSSender
- Client and server repositories
- Screen shots of SonicMQ configuration for secure and insecure connection factories
- Screen shots of Hermes, an application that allows you to interact with JMS providers. I did this to make sure the secure and insecure connections can be established(while browsing) by a generic tool.