我希望在事务回滚中插入表中的值 所以我使用的是wso2esb4.7.0。为此,我希望编写类中介我在编写代码时遇到java错误 错误是 esb不适用于事务回滚选项,我的代码是
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse"
name="JmsStore_Seq"
trace="disable">
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="Authentication"
expression="//Authentication/text()"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="UserId"
expression="//UserId/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="WorkOUid"
expression="//WorkOUid/text()"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="WorkPartyBranchId"
expression="//WorkPartyBranchId/text()"/>
<filter xmlns:ns="http://org.apache.synapse/xsd"
xpath="get-property('Authentication')=''">
<then>
<payloadFactory>
<format>
<ResponseJSON xmlns="">
<Exception>Service trying to connect inactive service</Exception>
<Status>101503</Status>
</ResponseJSON>
</format>
<args/>
</payloadFactory>
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>
</then>
<else>
<filter xpath="get-property('Authentication')='false'">
<then>
<payloadFactory>
<format>
<ResponseJSON xmlns="">
<Exception>Authentication Failed</Exception>
<Status>401</Status>
</ResponseJSON>
</format>
<args/>
</payloadFactory>
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>
</then>
<else>
<property name="jmspayload"
expression="get-property('readingspayload')"
type="OM"/>
<property name="ResponseJSON" expression="$body/ResponseJSON" type="OM"/>
<property name="jmsuri" expression="get-property('jmsuri')"/>
<property name="jmsqueue" expression="get-property('jmsqueue')"/>
<payloadFactory >
<format>
<PLData>
<JMpayload>$1</JMpayload>
<AuthData>$2</AuthData>
</PLData>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('jmspayload')" />
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ResponseJSON')"/>
</args>
</payloadFactory>
<class name="in.youtility.esb.custommediators.JMSStoreMediator" />
<payloadFactory>
<format>
<ResponseJSON xmlns="">
<Body>
<Datalist>
<Data>Successfully stored</Data>
</Datalist>
</Body>
<Status>200</Status>
</ResponseJSON>
</format>
<args/>
</payloadFactory>
<header name="To" action="remove"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<property name="RESPONSE" value="true"/>
<send/>
</else>
</filter>
</else>
</filter>
<description/>
</sequence>
我正在为这个java类写作,但我找不到jar文件,我在哪里可以找到它 谢谢 费萨尔
答案 0 :(得分:1)
如果您需要编写班级调解员,可以点击此链接。它描述了创建jar文件并将其安装在ESB中的所有步骤。
http://soatutorials.blogspot.com/2013/08/10-minute-tutorial-for-extending-wso2.html
答案 1 :(得分:0)
在ESB中进行数据库事务的最简单可扩展的推荐方法是在ESB中使用WSO2 DSS。您可以非常轻松地编写数据服务以将数据插入DB。并使用ESB事务中介[1]来实现事务。
[1] - http://docs.wso2.org/display/ESB470/Transaction+Mediator