与ESB部署时,数据服务失败



我有一个数据服务,该数据服务在仅在DSS环境中部署时可以很好地工作。部署在具有DSS和ESB的环境中时的确切数据服务将使具有简单输入参数的操作失败。

关于失败的任何指示,都将不胜感激。

数据服务有两个操作;

  1. 简单获取没有输入参数的信息,getlastrequest
  2. 更复杂的GET操作,其中传递单个DateTime参数,GetNewRequests

当仅在DSS环境中部署时,这两个操作都使用Tryit

按预期工作

部署在DSS/ESB环境中时,第一个操作按预期工作。使用Tryit

时,第二个操作失败了

操作2:getNewRequests

DSS配置

<data name="ServiceMagnetRequestMonitor" transports="http">
   <config id="ServiceMagnetStaging">
      <property name="driverClassName">com.mysql.jdbc.Driver</property>
      <property name="url">jdbc:mysql://localhost:3307/servicem_staging_engine</property>
      <property name="username">root</property>
      <property name="password">password</property>
   </config>
   <config id="ServiceMagnetRulesConfig">
      <property name="driverClassName">com.mysql.jdbc.Driver</property>
      <property name="url">jdbc:mysql://localhost:3307/servicemagnetrulesconfig</property>
      <property name="username">root</property>
      <property name="password">password</property>
   </config>
   <query id="GetLastRequest_SQL" useConfig="ServiceMagnetRulesConfig">
      <sql>SELECT datevalue, NOW() as currenttime FROM dateconfigurations WHERE        (configname = 'LastInspectionRequest')</sql>
      <result element="Configurations" rowName="Configuration">
         <element column="datevalue" name="datevalue" xsdType="dateTime"/>
         <element column="currenttime" name="currenttime" xsdType="dateTime"/>
      </result>
   </query>
   <query id="GetNewRequests_SQL" useConfig="ServiceMagnetStaging">
      <sql>SELECT requests.id, requests.name, requests.telephone, requests.email, languages.name AS preflanguage, locations.name AS location, regions.name AS region, provinces.name AS province, requests.timeframe_date, requests.timeframe, requests.created_at&#13;FROM            provinces, regions, locations, requests, languages&#13;WHERE        provinces.id = regions.province_id AND regions.id = locations.region_id AND locations.id = requests.location_id AND requests.language_id = languages.id AND (requests.created_at &gt; :LastRequest_IN)</sql>
      <result element="Requests" rowName="Request">
         <element column="id" name="id" xsdType="string"/>
         <element column="name" name="name" xsdType="string"/>
         <element column="telephone" name="telephone" xsdType="string"/>
         <element column="email" name="email" xsdType="string"/>
         <element column="preflanguage" name="preflanguage" xsdType="string"/>
         <element column="location" name="location" xsdType="string"/>
         <element column="region" name="region" xsdType="string"/>
         <element column="province" name="province" xsdType="string"/>
         <element column="timeframe_date" name="timeframe_date" xsdType="date"/>
         <element column="timeframe" name="timeframe" xsdType="string"/>
         <element column="created_at" name="created_at" xsdType="dateTime"/>
      </result>
      <param name="LastRequest_IN" sqlType="TIMESTAMP"/>
   </query>
   <operation name="GetLastRequest">
      <call-query href="GetLastRequest_SQL"/>
   </operation>
   <operation name="GetNewRequests">
      <call-query href="GetNewRequests_SQL">
         <with-param name="LastRequest_IN" query-param="LastRequest_IN"/>
      </call-query>
   </operation>
</data>

使用Tryit

返回的错误
<soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:axis2ns5336="http://ws.wso2.org/dataservice">
   <soapenv:Code>
      <soapenv:Value>axis2ns5336:INCOMPATIBLE_PARAMETERS_ERROR</soapenv:Value>
   </soapenv:Code>
   <soapenv:Reason>
      <soapenv:Text xml:lang="en-US">DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:LastRequest_IN
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: ServiceMagnetRequestMonitor
Location: ServiceMagnetRequestMonitor.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: GetNewRequests
Current Params: {}
</soapenv:Text>
   </soapenv:Reason>
   <soapenv:Detail>
      <axis2ns5335:DataServiceFault xmlns:axis2ns5335="http://ws.wso2.org/dataservice">DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:LastRequest_IN
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: ServiceMagnetRequestMonitor
Location: ServiceMagnetRequestMonitor.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: GetNewRequests
Current Params: {}
</axis2ns5335:DataServiceFault>
   </soapenv:Detail>
</soapenv:Fault>

以下实际解决了上面确定的问题,但是实际解决方案似乎需要WSO2的修复。我会为此记录一个jira。

请注意,以下说明不要导致安装或进一步升级的任何问题。这些更改是纯配置和完全支持的。

问题与报道一样。在同一实例中运行DSS和ESB会导致一些具有输入参数的DSS失败。

解决方案 ->解决方法简单地说,直到缺陷解决,您不能在同一碳实例中运行DSS和ESB。但是,您可以在两台机器上运行DSS和ESB,也可以如下所述,在同一台计算机上运行两个实例。

uhhh,gee rob,如果解决方案是为了进行DSS操作,为什么要经过所有这些努力?为什么不只是设置DSS而忘记ESB呢?由于想在一台计算机上一起使用DSS和ESB的功能而引起的答案。如果您需要的只是基本DSS功能,那么您可以停止阅读。但是,如果您需要在同一台计算机上都可以从两者中扮演功能,请继续。

在一台计算机上运行ESB和DSS

  1. 独立安装DSS和ESB。
  2. 确保两次运行
  3. ESB必须以1的端口偏移启动1。可以在/repository/conf/carbon.xml文件中设置端口偏移量。将偏移值设置为1
  4. 启动两个实例
  5. ESB现在需要代理DSS服务,我们遇到了问题。使用以下结构https://docs.wso2.com/display/esb470/pass through through proxy proxy template
  6. ,在ESB中创建一个传递代理到DSS。
  7. 现在使用ESB的尝试。成功!

我希望您对此有所帮助。

我以前遇到过同样的问题,但我设法找到了一个解决方法:替换文件$ carbon_home/repository/conf/conf/axis2.xml by $ carbon_home/repository/conf/conf/axis2_nhttp.xml

这将替换HTTP运输的NHTTP实现的通行证,这与独立DSS中使用。

请注意,这将对代理产生负面影响,因此您可能更喜欢坚持两个碳实例。

最新更新