Oracle MAF Web服务调用数据控制方法SOAP错误

时间:2014-10-29 21:54:11

标签: web-services mobile soap oracle-adf oracle-maf

我们将非常感谢您解决此invokeDataControl方法的任何帮助。请查看下面的链接以获取问题的完整参考。我基本上试图执行一个Oracle / Java MAF示例来理解这个概念,并将其呈现给用户以实现关键的go / no-go情况。

环境:

1)Jdeveloper 12.1.3.0.0 2)MAF 2.0.1 3)尝试的示例:https://java.net/projects/smuenchadf/pages/ADFMobile中的DSI037 或" http://deepakcs.blogspot.com/2013/06/offline-data-synchronization-for-adf.html" 4)MAC OS 10.9 5)WebLogic 12C 6)错误消息

[SEVERE - oracle.adfmf.framework - HttpServiceConnection - log]连接错误:500 [SEVERE - oracle.adfmf.framework - HttpTransport - parseResponse]响应[错误:{0}]:{1} [SEVERE - oracle.adfmf.framework - SoapTransportLayer - invokeSoapRequest]调用SOAP请求时遇到异常 终点:http://XXX.XXX.XXX.XXX:80/EJBSyncWebServiceApp/SessionFacadeBeanService SOAPAction:" http://service.soap.dsid.com/persistDepartments" 例外:HTTP状态代码500内部服务器错误:服务器遇到意外情况,导致服务器无法完成请求。

7)更多细节:

执行了以下代码。该方法和所有其他方法在HTTP分析器中或单独执行时(绑定" persistDepartments"带按钮)正常工作,但在AdfmfJavaUtilities.invokeDataControlMethod

中不包装时
public void syncDataFromOfflineToOnline() {

      Trace.log(Utility.FrameworkLogger, Level.FINE, this.getClass(), "syncDataFromOfflineToOnline",
              "Executing syncDataFromOfflineToOnline Method");
    try {
        Connection conn = DBConnectionFactory.getConnection();
        conn.setAutoCommit(false);
        PreparedStatement pStmt =
            conn.prepareStatement("SELECT DEPARTMENT_ID, DEPARTMENT_NAME, LOCATION_NAME, STATUS from DEPARTMENTS WHERE STATUS IN (?, ?, ?)");
        pStmt.setString(1, STATUS_NEWLY_CREATED);
        pStmt.setString(2, STATUS_MODIFIED);
        pStmt.setString(3, STATUS_DELETED);
        ResultSet rs = pStmt.executeQuery();
        while (rs.next()) {

            List namesList = new ArrayList(1);
            List paramsList = new ArrayList(1);
            List typesList = new ArrayList(1);


            Departments dept = new Departments();
            dept.setDepartmentId(rs.getInt("DEPARTMENT_ID"));
            dept.setDepartmentName(rs.getString("DEPARTMENT_NAME"));
            dept.setLocationName(rs.getString("LOCATION_NAME"));
            dept.setStatus(STATUS_NOT_CHANGED);


            if (rs.getString("STATUS").equals(STATUS_NEWLY_CREATED)) {
                System.out.println("I got a STATUS_NEWLY_CREATED");
                GenericType gtDept =
                    GenericTypeBeanSerializationHelper.toGenericType("MYWS.Types.persistDepartments.arg0",
                                                                     dept);
                namesList.add("arg0");
                paramsList.add(gtDept);
                typesList.add(Object.class);

                AdfmfJavaUtilities.invokeDataControlMethod("MYWS", null, "persistDepartments", namesList,
                                                           paramsList, typesList);
                //Once the data sync with online, change the status for the row as STATUS_NOT_CHANGED

                PreparedStatement pStmt1 =
                    conn.prepareStatement("UPDATE DEPARTMENTS SET STATUS=? WHERE DEPARTMENT_ID=?");
                pStmt1.setString(1, STATUS_NOT_CHANGED);
                pStmt1.setInt(2, rs.getInt("DEPARTMENT_ID"));
                pStmt1.execute();              
                conn.commit();

                <<< more codes >>>

1 个答案:

答案 0 :(得分:1)

我遇到了这个问题。

将typesList.add(Object.class)更改为typesList.add(GenericType.class)