未使用WSO2 DSS跟踪到数据库中的记录
我正在WSO2 EI 6.1.1中执行DSS操作。在管理控制台中检查DSS操作时,记录被跟踪到DB中,但当我试图通过编码执行相同的操作时,记录没有被跟踪到DB中,但如果我在端点调用之后放入,则作为响应成功。谁能告诉我这里怎么了 数据服务(XML):未使用WSO2 DSS跟踪到数据库中的记录,wso2,wso2dss,wso2ei,Wso2,Wso2dss,Wso2ei,我正在WSO2 EI 6.1.1中执行DSS操作。在管理控制台中检查DSS操作时,记录被跟踪到DB中,但当我试图通过编码执行相同的操作时,记录没有被跟踪到DB中,但如果我在端点调用之后放入,则作为响应成功。谁能告诉我这里怎么了 数据服务(XML): <data name="CarSalesDSS" transports="http https local"> <config enableOData="false"
<data name="CarSalesDSS" transports="http https local">
<config enableOData="false" id="CarSales_DataSource">
<property name="driverClassName">com.mysql.jdbc.Driver</property>
<property name="url">url</property>
<property name="username">username</property>
<property name="password">password</property>
<property name="autoCommit">true</property>
<property name="dataSourceProps"/>
<property name="dynamicUserAuthMapping">
<configuration/>
</property>
</config>
<query id="Staging_Leads_Query" useConfig="CarSales_DataSource">
<sql>insert into :Staging_LeadsTable(LeadID,Type,Salutation,FirstName,LastName,Email,MobilePhone) 
values (:LeadID,:Type,:Salutation,:FirstName,:LastName,:Email,:MobilePhone)
 ON DUPLICATE KEY UPDATE Type =:Type,Salutation =:Salutation,FirstName =:FirstName,LastName =:LastName,Email =:Email,MobilePhone =:MobilePhone</sql>
<param name="Staging_LeadsTable" sqlType="QUERY_STRING"/>
<param name="LeadID" sqlType="STRING"/>
<param name="Salutation" sqlType="STRING"/>
<param name="Type" sqlType="STRING"/>
<param name="FirstName" sqlType="STRING"/>
<param name="LastName" sqlType="STRING"/>
<param name="Email" sqlType="STRING"/>
<param name="MobilePhone" sqlType="STRING"/>
</query>
<operation name="Staging_Leads_Opr" returnRequestStatus="true">
<call-query href="Staging_Leads_Query">
<with-param name="Staging_LeadsTable" query-param="Staging_LeadsTable"/>
<with-param name="LeadID" query-param="LeadID"/>
<with-param name="Salutation" query-param="Salutation"/>
<with-param name="Type" query-param="Type"/>
<with-param name="FirstName" query-param="FirstName"/>
<with-param name="LastName" query-param="LastName"/>
<with-param name="Email" query-param="Email"/>
<with-param name="MobilePhone" query-param="MobilePhone"/>
</call-query>
</operation>
</data>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:dat="http://ws.wso2.org/dataservice" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<p:Staging_Leads_Opr xmlns:p="http://ws.wso2.org/dataservice">
<!--Exactly 1 occurrence-->
<xs:Staging_LeadsTable xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:Staging_LeadsTable>
<!--Exactly 1 occurrence-->
<xs:LeadID xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Id/text()</xs:LeadID>
<!--Exactly 1 occurrence-->
<xs:Salutation xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Salutation/text()</xs:Salutation>
<!--Exactly 1 occurrence-->
<xs:Type xmlns:xs="http://ws.wso2.org/dataservice">Lead</xs:Type>
<!--Exactly 1 occurrence-->
<xs:FirstName xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/FirstName/text()</xs:FirstName>
<!--Exactly 1 occurrence-->
<xs:LastName xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/LastName/text()</xs:LastName>
<!--Exactly 1 occurrence-->
<xs:Email xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Email/text()</xs:Email>
<!--Exactly 1 occurrence-->
<xs:MobilePhone xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/MobilePhone/text()</xs:MobilePhone>
</p:Staging_Leads_Opr>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('Staging_LeadsTable')"/>
</args>
</payloadFactory>
<call description="CarSalesDSS">
<endpoint key="CarSalesDSS"/>
</call>
com.mysql.jdbc.Driver
网址
用户名
密码
真的
插入:Staging_LeadsTable(LeadID、类型、称呼、名字、姓氏、电子邮件、手机)和xd;值(:LeadID、:Type、:saltation、:FirstName、:LastName、:Email、:MobilePhone)和#xd;在重复密钥更新时,Type=:Type,saltation=:saltation,FirstName=:FirstName,LastName=:LastName,Email=:Email,MobilePhone=:MobilePhone
DSS呼叫编码):
<data name="CarSalesDSS" transports="http https local">
<config enableOData="false" id="CarSales_DataSource">
<property name="driverClassName">com.mysql.jdbc.Driver</property>
<property name="url">url</property>
<property name="username">username</property>
<property name="password">password</property>
<property name="autoCommit">true</property>
<property name="dataSourceProps"/>
<property name="dynamicUserAuthMapping">
<configuration/>
</property>
</config>
<query id="Staging_Leads_Query" useConfig="CarSales_DataSource">
<sql>insert into :Staging_LeadsTable(LeadID,Type,Salutation,FirstName,LastName,Email,MobilePhone) 
values (:LeadID,:Type,:Salutation,:FirstName,:LastName,:Email,:MobilePhone)
 ON DUPLICATE KEY UPDATE Type =:Type,Salutation =:Salutation,FirstName =:FirstName,LastName =:LastName,Email =:Email,MobilePhone =:MobilePhone</sql>
<param name="Staging_LeadsTable" sqlType="QUERY_STRING"/>
<param name="LeadID" sqlType="STRING"/>
<param name="Salutation" sqlType="STRING"/>
<param name="Type" sqlType="STRING"/>
<param name="FirstName" sqlType="STRING"/>
<param name="LastName" sqlType="STRING"/>
<param name="Email" sqlType="STRING"/>
<param name="MobilePhone" sqlType="STRING"/>
</query>
<operation name="Staging_Leads_Opr" returnRequestStatus="true">
<call-query href="Staging_Leads_Query">
<with-param name="Staging_LeadsTable" query-param="Staging_LeadsTable"/>
<with-param name="LeadID" query-param="LeadID"/>
<with-param name="Salutation" query-param="Salutation"/>
<with-param name="Type" query-param="Type"/>
<with-param name="FirstName" query-param="FirstName"/>
<with-param name="LastName" query-param="LastName"/>
<with-param name="Email" query-param="Email"/>
<with-param name="MobilePhone" query-param="MobilePhone"/>
</call-query>
</operation>
</data>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:dat="http://ws.wso2.org/dataservice" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<p:Staging_Leads_Opr xmlns:p="http://ws.wso2.org/dataservice">
<!--Exactly 1 occurrence-->
<xs:Staging_LeadsTable xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:Staging_LeadsTable>
<!--Exactly 1 occurrence-->
<xs:LeadID xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Id/text()</xs:LeadID>
<!--Exactly 1 occurrence-->
<xs:Salutation xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Salutation/text()</xs:Salutation>
<!--Exactly 1 occurrence-->
<xs:Type xmlns:xs="http://ws.wso2.org/dataservice">Lead</xs:Type>
<!--Exactly 1 occurrence-->
<xs:FirstName xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/FirstName/text()</xs:FirstName>
<!--Exactly 1 occurrence-->
<xs:LastName xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/LastName/text()</xs:LastName>
<!--Exactly 1 occurrence-->
<xs:Email xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/Email/text()</xs:Email>
<!--Exactly 1 occurrence-->
<xs:MobilePhone xmlns:xs="http://ws.wso2.org/dataservice">$body/jsonObject/Lead/MobilePhone/text()</xs:MobilePhone>
</p:Staging_Leads_Opr>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('Staging_LeadsTable')"/>
</args>
</payloadFactory>
<call description="CarSalesDSS">
<endpoint key="CarSalesDSS"/>
</call>
$1
$body/jsonObject/Lead/Id/text()
$body/jsonObject/Lead/saltation/text()
领导
$body/jsonObject/Lead/FirstName/text()
$body/jsonObject/Lead/LastName/text()
$body/jsonObject/Lead/Email/text()
$body/jsonObject/Lead/MobilePhone/text()
能否尝试在调用中介之前添加操作头
<header name="Action" value="urn:Staging_Leads_Opr" scope="default"/>
我通过在payload Factory Mediator的arg参数中输入值解决了上述问题。但仍然不知道为什么直接映射不起作用
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:dat="http://ws.wso2.org/dataservice" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<p:Staging_Leads_Opr xmlns:p="http://ws.wso2.org/dataservice">
<!--Exactly 1 occurrence-->
<xs:Staging_LeadsTable xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:Staging_LeadsTable>
<!--Exactly 1 occurrence-->
<xs:LeadID xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:LeadID>
<!--Exactly 1 occurrence-->
<xs:Salutation xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:Salutation>
</p:Staging_Leads_Opr>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('Staging_LeadsTable')"/>
<arg evaluator="xml" expression="$body/jsonObject/Lead/Id/text()"/>
<arg evaluator="xml" expression="$body/jsonObject/Lead/Salutation/text()"/>
<arg evaluator="xml" value="Lead"/>
</args>
</payloadFactory>
<call description="CarSalesDSS">
<endpoint key="CarSalesDSS"/>
</call>
$1
$2
$3
Hi@Shanaka Premarathna,感谢您的回复,尝试了相同的操作,但此操作标题对我没有帮助。