soap采用XML来处理它的内容,XML相关的工具很多,我们可以很容易用一些代码生成工具来根据一个XML Schmema来得到一个发送soap消息的客户端。
但有些时候,我们需要用JMS来实现我们发布/订阅的逻辑,可以采用一种方法把soap消息发送到一个JMS topic。
我们可以用WSO2 ESB来实现,参考文档中的sample 251
首先需要把ESB和JMS整合起来,这里采用的是ActiveMQ
对于jms的配置,需要在axis2.xml中进行,因为Wso2 esb是建立在synapse之上,而synapse又是以axis2为核心的。
修改axis2.xml中关于jms的配置,你可以查找"jms",把相关的“transportReceiver”和“transportSender”的注释打开。
把ActiveMQ的三个库文件activeio-core-3.0-beta1.jar, activemq-core-4.0-RC2.jar, geronimo-j2ee-management_1.0_spec-1.0.jar
拷贝到ESB的repository/components/lib目录。
下面参照sample 251就可以实现我们需要的功能,但有一点需要注意:
代理(Proxy)不要打开jms协议,如果打开的话,下面我们设置的endpoint就会变成消息消费者,而不是发送者。
June 29, 2010 at 4:26 am
hi there,
I appreciate your effort of providing WSO2 ESB related uses cases in your native language. If you have further question please do let me know. Also I encourage you to ask more question and if you come across any questions please don’t hesitate to raise them. Keep up the good work.
Rajika
June 29, 2010 at 4:37 am
OK, thanks for your help! I’ll keep in mind.@rajika