WSO2 EI:数据服务通过REST API调用时使用了INCOMPATIBLE_PARAMETERS_ERROR的功能

时间:2018-10-10 18:05:21

标签: wso2 wso2esb wso2ei

我正在使用WSO2 EI 6.3.0版本。我正在从CSV读取数据的应用程序中创建数据服务。 我遇到了非常不寻常的情况,其中我创建了两个数据服务。 WSO2 EI附带一个示例Product.csv。 调用Sample(Product.CSV)时,我可以获取json响应消息。但是当我尝试调用另一个API和其他数据服务时,却给了我以下错误:

[2018-10-10 17:57:31,916] [EI-Core] ERROR - JsonStreamFormatter Error occurred while writing to application/json
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.carbon.integrator.core.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:107)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:597)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:281)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in     CSVQuery.runQuery.
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: InvoiceReport
Location: /InvoiceReport.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: _getinvoice
Current Params: {}
Nested Exception:-
DS Fault Message: Error in 'StaticOutputElement.execute', cannot find   parameter with type:column name:Docnumber
DS Code: INCOMPATIBLE_PARAMETERS_ERROR

下面是数据服务:

<data name="InvoiceReport" transports="http https local">
<config enableOData="false" id="CSV_InvoiceReport">
<property name="csv_datasource">/usr/lib/wso2/wso2ei/6.3.0/samples/data-services/resources/Invoice.csv</property>
<property name="csv_columnseperator">comma</property>
<property name="csv_startingrow">2</property>
<property name="csv_hasheader">true</property>
<property name="csv_headerrow">1</property>

</config>
<query id="Q2" useConfig="CSV_InvoiceReport">
  <result outputType="json">{&#xd; "Products": {&#xd; "Product": [&#xd; {&#xd; "Docnumber":"$Docnumber",&#xd; "Invoicenumber":"$Invoicenumber",&#xd; "Documentdate":"$Documentdate",&#xd; "Invoiceduedate":"$Invoiceduedate",&#xd; "Customerid":"$Customerid",&#xd; "Documenttotal":"$Documenttotal",&#xd; "Quantity":"$Quantity",&#xd; "Unitprice":"$Unitprice",&#xd; "Extendedprice":"$Extendedprice",&#xd; "Consumer":"$Consumer",&#xd; "Servicename":"$Servicename"&#xd;&#xd; }&#xd; ]&#xd; }&#xd;}&#xd;</result>
</query>
<operation name="GetInvoiceReport">
  <call-query href="Q2"/>
</operation>
<resource method="GET" path="Invoice">
  <call-query href="Q2"/>
</resource>
</data>

不知道问题出在哪里。两者都是简单的数据服务,在创建它们时没有发现任何区别。一个正在工作,一个根本没有工作。

有人可以帮我吗?这是错误吗?

谢谢。

0 个答案:

没有答案