2013-02-15 49 views
1

我的工作MAC OS X執行存儲過程 - 10.7.5與WSO2 ESB 4.6.0和數據服務功能 - 4.0.5ESB 4.6.0與數據服務器插件 - 無法與REF_CURSOR

的Java Java版本「1.6.0_37」 Java™SE運行時環境(內部版本1.6.0_37-b06-434-11M3909) Java HotSpot™64位服務器虛擬機(版本20.12-b01-434,混合模式)

我想用ref遊標執行存儲過程。

這裏是我的DS

<data name="RZM"> 
    <config id="RZS_Data"> 
     <property name="driverClassName">oracle.jdbc.driver.OracleDriver</property> 
     <property name="url">XXXX</property> 
     <property name="username">XXXX</property> 
     <property name="password">XXXX</property> 
     <property name="defaultTransactionIsolation">TRANSACTION_READ_COMMITTED</property> 
    </config> 
    <query id="TEST" useConfig="RZS_Data"> 
     <sql>call RT_PROC_GET_VERSION(:in_app_id,:in_version_id,?,?,?)</sql> 
     <result element="Results" rowName="Result"> 
     <element column="app_url" name="app_url" optional="true" xsdType="string"/> 
     <element column="out_message" name="OutMessage" optional="true" xsdType="string"/> 
     <element column="out_err_message" name="out_err_message" optional="true" xsdType="string"/> 
     </result> 
     <param name="in_app_id" ordinal="1" sqlType="INTEGER" type="INOUT"/> 
     <param name="in_version_id" ordinal="2" sqlType="STRING" type="INOUT"/> 
     <param name="compare_from_id" ordinal="3" paramType="ARRAY" sqlType="ORACLE_REF_CURSOR" type="OUT"/> 
     <param name="out_message" ordinal="4" sqlType="STRING" type="OUT"/> 
     <param name="out_err_message" ordinal="5" sqlType="STRING" type="OUT"/> 
    </query> 
    <operation name="TOP"> 
     <call-query href="TEST"> 
     <with-param name="in_app_id" query-param="in_app_id"/> 
     <with-param name="in_version_id" query-param="in_version_id"/> 
     </call-query> 
    </operation> 
</data> 

我收到以下錯誤所有我不知道爲什麼我得到這個錯誤的時間

[2013-02-14 18:00:14,400] ERROR - DataService DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

    at org.wso2.carbon.dataservices.core.engine.CallQuery.extractParams(CallQuery.java:208) 
    at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:177) 
    at org.wso2.carbon.dataservices.core.engine.CallQueryGroup.executeElement(CallQueryGroup.java:111) 
    at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89) 
    at org.wso2.carbon.dataservices.core.description.operation.Operation.execute(Operation.java:71) 
    at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:548) 
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:99) 
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110) 
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691) 
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) 
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245) 
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) 
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227) 
    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.processEntityEnclosingRequest(ServerWorker.java:434) 
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219) 
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:680) 
[2013-02-14 18:00:14,402] ERROR - PassThroughHttpSender Failed to submit the response 
org.apache.axis2.AxisFault: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) 
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227) 
    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.processEntityEnclosingRequest(ServerWorker.java:434) 
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219) 
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:680) 
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:105) 
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110) 
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691) 
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) 
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245) 
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) 
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74) 
    ... 12 more 
[2013-02-14 18:00:14,403] ERROR - ServerWorker Error processing POST request for : /services/RZM.SOAP12Endpoint/TOP 
org.apache.axis2.AxisFault: Failed to submit the response 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:496) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:229) 
    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.processEntityEnclosingRequest(ServerWorker.java:434) 
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219) 
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:680) 
Caused by: org.apache.axis2.AxisFault: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) 
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435) 
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227) 
    ... 10 more 
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id 
DS Code: INCOMPATIBLE_PARAMETERS_ERROR 
Source Data Service:- 
Name: RZM 
Location: /RZM.dbs 
Description: N/A 
Default Namespace: http://ws.wso2.org/dataservice 
Current Request Name: TOP 
Current Params: {} 

    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:105) 
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110) 
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691) 
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) 
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283) 
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245) 
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) 
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74) 
    ... 12 more 

。我試圖用「TryIt」服務執行DS。輸入XML是繼

<body> 
    <p:TOP xmlns:p="http://ws.wso2.org/dataservice"> 
     <!--Exactly 1 occurrence--> 
     <p:in_app_id>1296</p:in_app_id> 
     <!--Exactly 1 occurrence--> 
     <p:in_version_id>2.2</p:in_version_id> 
    </p:TOP> 
</body> 

存儲過程定義開始與以下

 create or replace procedure RT_PROC_GET_VERSION (in_app_id    in number, 
                in_version_id   in varchar2, 
                out_version_detail  out sys_refcursor, 
                out_message    out varchar2, 
                out_err_message   out varchar2) 
    is 
    begin 
      open out_version_detail for 
      select 
        app_url, switch_board_url, version 
. 
. 

end RT_PROC_GET_VERSION; 

能否請你幫忙嗎? 感謝 作者Abhijit

回答

0

阿濟斯,

使用「命名參數」,並都在同一時間「序號」(參數排序帶有號碼)將導致參數提取和分配的一些問題。我建議你統一使用「命名參數」選項或「序號」(兩者中只有一個)來分配所有輸入參數映射。這將解決問題。

希望這會有所幫助!

2

我一直在爲它奮鬥 我花了一些時間調試代碼,並認爲在MessageContext中請求的原因是'null'。 因此,它導致Axis2傳輸配置影響它。實際上,WSO2 ESB 4.6.0帶有默認的傳遞http傳輸,它不會創建消息體,這就是爲什麼傳遞給服務的任何內容都不起作用。 因此,爲了使它工作,您需要重新啓用替代http傳輸(例如查找和取消註釋org.wso2.carbon.core.transports.http.HttpTransportListenerrepository/conf/axis2/axis2.xml 這應該解決您的問題,以犧牲禁用通路。也許有辦法在不同的端口上並排配置傳輸(任務供以後使用)

一句話,通常你應該分開保存ESB和DSS,因爲解決不同的任務需要特定的配置。

0

試試這個電話RT_​​PROC_GET_VERSION(?,?,?,?,?)

而且在輸入映射選項列表中的所有進出參數與序。 序號將基於問號。 有一件事是上述查詢中出現的問號應該與呈現您的存儲過程相同。 之後從存儲過程中,如果有任何數據將它們列出參數

例如:如果您的結果集帶有id和地址,然後列出這兩個輸出映射。 注意:輸入映射名稱應與存儲過程中的名稱相同。