Search in sources :

Example 1 with MWebServiceType

use of org.idempiere.webservices.model.MWebServiceType in project idempiere by idempiere.

the class ModelADServiceImpl method updateData.

public StandardResponseDocument updateData(ModelCRUDRequestDocument req) {
    Trx trx = null;
    try {
        getCompiereService().connect();
        StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance();
        StandardResponse resp = ret.addNewStandardResponse();
        ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD();
        String serviceType = modelCRUD.getServiceType();
        ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest();
        String err = login(reqlogin, webServiceName, "updateData", serviceType);
        if (err != null && err.length() > 0) {
            resp.setError(err);
            resp.setIsError(true);
            return ret;
        }
        // Validate parameters vs service type
        try {
            validateCRUD(modelCRUD);
        } catch (IdempiereServiceFault e) {
            resp.setError(e.getMessage());
            resp.setIsError(true);
            return ret;
        }
        String tableName = modelCRUD.getTableName();
        int recordID = modelCRUD.getRecordID();
        resp.setRecordID(recordID);
        CompiereService m_cs = getCompiereService();
        MWebServiceType m_webservicetype = getWebServiceType();
        Properties ctx = m_cs.getCtx();
        // start a trx
        String trxName = localTrxName;
        if (trxName == null) {
            trxName = Trx.createTrxName("ws_modelCreateData");
            manageTrx = true;
        }
        trx = Trx.get(trxName, true);
        if (manageTrx)
            trx.setDisplayName(getClass().getName() + "_" + webServiceName + "_updateData");
        // get the PO for the tablename and record ID
        MTable table = MTable.get(ctx, tableName);
        if (table == null)
            return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName);
        PO po = table.getPO(recordID, trxName);
        if (po == null)
            return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
        POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
        if (po.get_ColumnIndex("Processed") >= 0 && po.get_ValueAsBoolean("Processed")) {
            resp.setError("Record is processed and can not be updated");
            resp.setIsError(true);
            return ret;
        }
        DataRow dr = modelCRUD.getDataRow();
        StandardResponseDocument retResp = scanFields(dr.getFieldArray(), m_webservicetype, po, poinfo, trx, resp, ret);
        if (retResp != null)
            return retResp;
        if (!po.validForeignKeys())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message"));
        if (!po.save())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message"));
        // close the trx
        if (manageTrx && !trx.commit())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after create record " + recordID + " in " + tableName);
        setOuputFields(resp, m_webservicetype, po, poinfo);
        return ret;
    } finally {
        if (manageTrx && trx != null)
            trx.close();
        getCompiereService().disconnect();
    }
}
Also used : ADLoginRequest(org.idempiere.adInterface.x10.ADLoginRequest) MWebServiceType(org.idempiere.webservices.model.MWebServiceType) StandardResponse(org.idempiere.adInterface.x10.StandardResponse) IdempiereServiceFault(org.idempiere.webservices.fault.IdempiereServiceFault) Properties(java.util.Properties) DataRow(org.idempiere.adInterface.x10.DataRow) StandardResponseDocument(org.idempiere.adInterface.x10.StandardResponseDocument) POInfo(org.compiere.model.POInfo) MTable(org.compiere.model.MTable) ModelCRUD(org.idempiere.adInterface.x10.ModelCRUD) Trx(org.compiere.util.Trx) PO(org.compiere.model.PO)

Example 2 with MWebServiceType

use of org.idempiere.webservices.model.MWebServiceType in project idempiere by idempiere.

the class ModelADServiceImpl method queryData.

public WindowTabDataDocument queryData(ModelCRUDRequestDocument req) {
    Trx trx = null;
    try {
        getCompiereService().connect();
        CompiereService m_cs = getCompiereService();
        WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance();
        WindowTabData resp = ret.addNewWindowTabData();
        ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD();
        String serviceType = modelCRUD.getServiceType();
        ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest();
        String err = login(reqlogin, webServiceName, "queryData", serviceType);
        if (err != null && err.length() > 0) {
            resp.setError(err);
            return ret;
        }
        // Validate parameters vs service type
        validateCRUD(modelCRUD);
        Properties ctx = m_cs.getCtx();
        String tableName = modelCRUD.getTableName();
        Map<String, Object> reqCtx = getRequestCtx();
        MWebServiceType m_webservicetype = getWebServiceType();
        // get the PO for the tablename and record ID
        MTable table = MTable.get(ctx, tableName);
        if (table == null)
            throw new IdempiereServiceFault("Web service type " + m_webservicetype.getValue() + ": table " + tableName + " not found", new QName("queryData"));
        int roleid = reqlogin.getRoleID();
        MRole role = MRole.get(ctx, roleid);
        // start a trx
        String trxName = localTrxName;
        if (trxName == null) {
            trxName = Trx.createTrxName("ws_modelQueryData");
            manageTrx = true;
        }
        trx = Trx.get(trxName, true);
        if (manageTrx)
            trx.setDisplayName(getClass().getName() + "_" + webServiceName + "_queryData");
        StringBuilder sqlBuilder = new StringBuilder(role.addAccessSQL("SELECT * FROM " + tableName, tableName, true, MRole.SQL_RO));
        ArrayList<Object> sqlParaList = new ArrayList<Object>();
        PO holderPo = table.getPO(0, trxName);
        POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
        if (modelCRUD.getDataRow() != null) {
            DataRow dr = modelCRUD.getDataRow();
            DataField[] fields = dr.getFieldArray();
            StandardResponseDocument stdRet = StandardResponseDocument.Factory.newInstance();
            StandardResponse stdResp = stdRet.addNewStandardResponse();
            StandardResponseDocument retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIMING_BEFORE_PARSE, holderPo, fields, trx, reqCtx, stdResp, stdRet);
            if (retResp != null) {
                throw new IdempiereServiceFault(retResp.getStandardResponse().getError(), new QName("queryData"));
            }
            retResp = scanFields(fields, m_webservicetype, holderPo, poinfo, trx, stdResp, stdRet);
            if (retResp != null) {
                throw new IdempiereServiceFault(retResp.getStandardResponse().getError(), new QName("queryData"));
            }
            for (DataField field : modelCRUD.getDataRow().getFieldArray()) {
                if (m_webservicetype.isInputColumnNameAllowed(field.getColumn())) {
                    // Jan Thielemann Solution for query using the sentence like
                    X_WS_WebServiceFieldInput inputField = m_webservicetype.getFieldInput(field.getColumn());
                    I_AD_Column col = inputField.getAD_Column();
                    String sqlType = DisplayType.getSQLDataType(col.getAD_Reference_ID(), col.getColumnName(), col.getFieldLength());
                    if (sqlType.contains("CHAR"))
                        sqlBuilder.append(" AND ").append(field.getColumn()).append(" LIKE ?");
                    else
                        sqlBuilder.append(" AND ").append(field.getColumn()).append("=?");
                    sqlParaList.add(holderPo.get_Value(field.getColumn()));
                // End Jan Thielemann Solution for query using the sentence like
                } else if (m_webservicetype.getFieldInput(field.getColumn()) == null) {
                    // If not even ctx variable column
                    throw new IdempiereServiceFault("Web service type " + m_webservicetype.getValue() + ": input column " + field.getColumn() + " not allowed", new QName("queryData"));
                }
            }
        }
        if (modelCRUD.getFilter() != null && modelCRUD.getFilter().length() > 0) {
            String sql = parseSQL(" WHERE " + modelCRUD.getFilter(), sqlParaList, holderPo, poinfo, reqCtx);
            sqlBuilder.append(" AND ").append(sql.substring(6));
        }
        int cnt = 0;
        int rowCnt = 0;
        int offset = modelCRUD.getOffset();
        int limit = modelCRUD.getLimit();
        PreparedStatement pstmtquery = null;
        ResultSet rsquery = null;
        try {
            pstmtquery = DB.prepareStatement(sqlBuilder.toString(), trxName);
            DB.setParameters(pstmtquery, sqlParaList);
            rsquery = pstmtquery.executeQuery();
            // Angelo Dabala' (genied) must create just one DataSet, moved outside of the while loop
            DataSet ds = resp.addNewDataSet();
            while (rsquery.next()) {
                cnt++;
                if ((offset >= cnt) || (limit > 0 && offset + limit < cnt))
                    continue;
                rowCnt++;
                DataRow dr = ds.addNewDataRow();
                for (int i = 0; i < poinfo.getColumnCount(); i++) {
                    String columnName = poinfo.getColumnName(i);
                    if (m_webservicetype.isOutputColumnNameAllowed(columnName)) {
                        DataField dfid = dr.addNewField();
                        dfid.setColumn(columnName);
                        if (rsquery.getObject(columnName) instanceof byte[])
                            dfid.setVal(new String(Base64.encodeBase64(rsquery.getBytes(columnName))));
                        else
                            dfid.setVal(rsquery.getString(columnName));
                    }
                }
            }
        } catch (Exception e) {
            log.log(Level.SEVERE, e.getLocalizedMessage(), e);
            throw new IdempiereServiceFault(e);
        } finally {
            DB.close(rsquery, pstmtquery);
            rsquery = null;
            pstmtquery = null;
        }
        resp.setSuccess(true);
        resp.setRowCount(rowCnt);
        resp.setNumRows(rowCnt);
        resp.setTotalRows(cnt);
        resp.setStartRow(offset);
        return ret;
    } finally {
        if (manageTrx && trx != null)
            trx.close();
        getCompiereService().disconnect();
    }
}
Also used : ADLoginRequest(org.idempiere.adInterface.x10.ADLoginRequest) MWebServiceType(org.idempiere.webservices.model.MWebServiceType) DataSet(org.idempiere.adInterface.x10.DataSet) MRole(org.compiere.model.MRole) ArrayList(java.util.ArrayList) Properties(java.util.Properties) DataRow(org.idempiere.adInterface.x10.DataRow) StandardResponseDocument(org.idempiere.adInterface.x10.StandardResponseDocument) WindowTabDataDocument(org.idempiere.adInterface.x10.WindowTabDataDocument) ModelCRUD(org.idempiere.adInterface.x10.ModelCRUD) ResultSet(java.sql.ResultSet) Trx(org.compiere.util.Trx) X_WS_WebServiceFieldInput(org.idempiere.webservices.model.X_WS_WebServiceFieldInput) StandardResponse(org.idempiere.adInterface.x10.StandardResponse) IdempiereServiceFault(org.idempiere.webservices.fault.IdempiereServiceFault) QName(javax.xml.namespace.QName) I_AD_Column(org.compiere.model.I_AD_Column) WindowTabData(org.idempiere.adInterface.x10.WindowTabData) PreparedStatement(java.sql.PreparedStatement) SQLException(java.sql.SQLException) XmlValueOutOfRangeException(org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException) POInfo(org.compiere.model.POInfo) MTable(org.compiere.model.MTable) DataField(org.idempiere.adInterface.x10.DataField) PO(org.compiere.model.PO)

Example 3 with MWebServiceType

use of org.idempiere.webservices.model.MWebServiceType in project idempiere by idempiere.

the class ModelADServiceImpl method setDocAction.

/*
	 * Model oriented web service to change DocAction for documents, i.e.
	 * Complete a Material Receipt WARNING!!! This web service complete
	 * documents not via workflow, so it jump over any approval step considered
	 * in document workflow To complete documents using workflow it's better to
	 * use the runProcess web service
	 */
public StandardResponseDocument setDocAction(ModelSetDocActionRequestDocument req) {
    Trx trx = null;
    try {
        getCompiereService().connect();
        StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance();
        StandardResponse resp = ret.addNewStandardResponse();
        ModelSetDocAction modelSetDocAction = req.getModelSetDocActionRequest().getModelSetDocAction();
        String serviceType = modelSetDocAction.getServiceType();
        ADLoginRequest reqlogin = req.getModelSetDocActionRequest().getADLoginRequest();
        CompiereService m_cs = getCompiereService();
        String err = login(reqlogin, webServiceName, "setDocAction", serviceType);
        if (err != null && err.length() > 0) {
            resp.setError(err);
            resp.setIsError(true);
            return ret;
        }
        try {
            // Validate parameters
            modelSetDocAction.setTableName(validateParameter("tableName", modelSetDocAction.getTableName()));
            modelSetDocAction.setRecordID(validateParameter("recordID", modelSetDocAction.getRecordID()));
            modelSetDocAction.setDocAction(validateParameter("docAction", modelSetDocAction.getDocAction()));
        } catch (IdempiereServiceFault e) {
            resp.setError(e.getMessage());
            resp.setIsError(true);
            return ret;
        }
        Properties ctx = m_cs.getCtx();
        // start a trx
        String trxName = localTrxName;
        if (trxName == null) {
            trxName = Trx.createTrxName("ws_modelSetDocAction");
            manageTrx = true;
        }
        trx = Trx.get(trxName, true);
        if (manageTrx)
            trx.setDisplayName(getClass().getName() + "_" + webServiceName + "_setDocAction");
        Map<String, Object> requestCtx = getRequestCtx();
        String tableName = modelSetDocAction.getTableName();
        String recordIDVar = modelSetDocAction.getRecordIDVariable();
        int recordID = modelSetDocAction.getRecordID();
        if (recordIDVar != null && recordIDVar.startsWith("@")) {
            Integer retVal = (Integer) parseVariable(recordIDVar, null, null, requestCtx);
            if (retVal == null) {
                return rollbackAndSetError(trx, resp, ret, true, "Cannot resolve variable: " + recordIDVar);
            }
            recordID = retVal;
        }
        String docAction = modelSetDocAction.getDocAction();
        resp.setRecordID(recordID);
        // get the PO for the tablename and record ID
        MTable table = MTable.get(ctx, tableName);
        if (table == null)
            return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName);
        PO po = table.getPO(recordID, trxName);
        if (po == null)
            return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
        // set explicitly the column DocAction to avoid automatic process of
        // default option
        po.set_ValueOfColumn("DocAction", docAction);
        if (!po.save())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot save before set docAction: " + CLogger.retrieveErrorString("no log message"));
        MWebServiceType m_webservicetype = getWebServiceType();
        // For passing action to validators
        requestCtx.put("DocAction", docAction);
        // Fire Event
        StandardResponseDocument retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIMING_BEFORE_PARSE, po, null, trx, requestCtx, resp, ret);
        if (retResp != null)
            return retResp;
        // call process it
        try {
            if (!((org.compiere.process.DocAction) po).processIt(docAction))
                return rollbackAndSetError(trx, resp, ret, true, Msg.parseTranslation(ctx, "@FailedProcessingDocument@: " + ((org.compiere.process.DocAction) po).getProcessMsg()));
        } catch (Exception e) {
            return rollbackAndSetError(trx, resp, ret, true, e.toString());
        }
        // Fire Event
        retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIMING_BEFORE_SAVE, po, null, trx, requestCtx, resp, ret);
        if (retResp != null)
            return retResp;
        // close the trx
        if (!po.save())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot save after set docAction: " + CLogger.retrieveErrorString("no log message"));
        // Fire Event
        retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIMING_AFTER_SAVE, po, null, trx, requestCtx, resp, ret);
        if (retResp != null)
            return retResp;
        if (manageTrx && !trx.commit())
            return rollbackAndSetError(trx, resp, ret, true, "Cannot commit after docAction");
        // resp.setError("");
        resp.setIsError(false);
        POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
        setOuputFields(resp, m_webservicetype, po, poinfo);
        return ret;
    } finally {
        if (manageTrx && trx != null)
            trx.close();
        getCompiereService().disconnect();
    }
}
Also used : ADLoginRequest(org.idempiere.adInterface.x10.ADLoginRequest) MWebServiceType(org.idempiere.webservices.model.MWebServiceType) ModelSetDocAction(org.idempiere.adInterface.x10.ModelSetDocAction) StandardResponse(org.idempiere.adInterface.x10.StandardResponse) IdempiereServiceFault(org.idempiere.webservices.fault.IdempiereServiceFault) Properties(java.util.Properties) ModelSetDocAction(org.idempiere.adInterface.x10.ModelSetDocAction) SQLException(java.sql.SQLException) XmlValueOutOfRangeException(org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException) StandardResponseDocument(org.idempiere.adInterface.x10.StandardResponseDocument) POInfo(org.compiere.model.POInfo) MTable(org.compiere.model.MTable) Trx(org.compiere.util.Trx) PO(org.compiere.model.PO)

Example 4 with MWebServiceType

use of org.idempiere.webservices.model.MWebServiceType in project idempiere by idempiere.

the class AbstractService method authenticate.

/**
 * Authenticate user for requested service type
 * @param webServiceValue
 * @param methodValue
 * @param serviceTypeValue
 * @param m_cs
 * @return
 */
protected String authenticate(String webServiceValue, String methodValue, String serviceTypeValue, CompiereService m_cs) {
    MWebService m_webservice = MWebService.get(m_cs.getCtx(), webServiceValue);
    if (m_webservice == null || !m_webservice.isActive())
        return "Web Service " + webServiceValue + " not registered";
    X_WS_WebServiceMethod m_webservicemethod = m_webservice.getMethod(methodValue);
    if (m_webservicemethod == null || !m_webservicemethod.isActive())
        return "Method " + methodValue + " not registered";
    MWebServiceType m_webservicetype = null;
    String key = m_cs.getAD_Client_ID() + "|" + m_webservice.getWS_WebService_ID() + "|" + m_webservicemethod.getWS_WebServiceMethod_ID() + "|" + serviceTypeValue;
    synchronized (s_WebServiceTypeCache) {
        m_webservicetype = s_WebServiceTypeCache.get(m_cs.getCtx(), key, e -> new MWebServiceType(m_cs.getCtx(), e));
        if (m_webservicetype == null) {
            m_webservicetype = new Query(m_cs.getCtx(), MWebServiceType.Table_Name, "AD_Client_ID IN (0,?) AND WS_WebService_ID=? AND WS_WebServiceMethod_ID=? AND Value=?", null).setOnlyActiveRecords(true).setParameters(m_cs.getAD_Client_ID(), m_webservice.getWS_WebService_ID(), m_webservicemethod.getWS_WebServiceMethod_ID(), serviceTypeValue).setOrderBy(// IDEMPIERE-3394 give precedence to tenant defined if there are system+tenant
            "AD_Client_ID DESC").first();
            if (m_webservicetype != null) {
                s_WebServiceTypeCache.put(key, m_webservicetype, e -> new MWebServiceType(Env.getCtx(), e));
            }
        }
    }
    if (m_webservicetype == null)
        return "Service type " + serviceTypeValue + " not configured";
    getHttpServletRequest().setAttribute("MWebServiceType", m_webservicetype);
    int AD_Role_ID = Env.getAD_Role_ID(m_cs.getCtx());
    key = AD_Role_ID + "|" + m_webservicetype.get_ID();
    synchronized (s_RoleAccessCache) {
        Boolean bAccess = s_RoleAccessCache.get(key);
        if (bAccess == null) {
            // Check if role has access on web-service
            String hasAccess = DB.getSQLValueStringEx(null, ROLE_ACCESS_SQL, AD_Role_ID, AD_Role_ID, m_webservicetype.get_ID());
            bAccess = "Y".equals(hasAccess);
            s_RoleAccessCache.put(key, bAccess);
        }
        if (!bAccess.booleanValue()) {
            return "Web Service Error: Login role does not have access to the service type";
        }
    }
    String ret = invokeLoginValidator(null, m_cs.getCtx(), m_webservicetype, IWSValidator.TIMING_ON_AUTHORIZATION);
    if (ret != null && ret.length() > 0)
        return ret;
    m_cs.refreshLastAuthorizationTime();
    return null;
}
Also used : MWebService(org.idempiere.webservices.model.MWebService) CCache(org.compiere.util.CCache) ADLoginRequest(org.idempiere.adInterface.x10.ADLoginRequest) Env(org.compiere.util.Env) HashMap(java.util.HashMap) NamePair(org.compiere.util.NamePair) StandardResponseDocument(org.idempiere.adInterface.x10.StandardResponseDocument) Login(org.compiere.util.Login) Base64(org.apache.commons.codec.binary.Base64) ArrayList(java.util.ArrayList) EquinoxExtensionLocator(org.adempiere.base.equinox.EquinoxExtensionLocator) BigDecimal(java.math.BigDecimal) HttpServletRequest(javax.servlet.http.HttpServletRequest) Query(org.compiere.model.Query) DB(org.compiere.util.DB) WebServiceContext(javax.xml.ws.WebServiceContext) MWebService(org.idempiere.webservices.model.MWebService) Map(java.util.Map) X_WS_WebServiceTypeAccess(org.idempiere.webservices.model.X_WS_WebServiceTypeAccess) DataField(org.idempiere.adInterface.x10.DataField) X_WS_WebServiceMethod(org.idempiere.webservices.model.X_WS_WebServiceMethod) Trx(org.compiere.util.Trx) POInfo(org.compiere.model.POInfo) OutputField(org.idempiere.adInterface.x10.OutputField) CompiereService(org.idempiere.adinterface.CompiereService) MessageContext(javax.xml.ws.handler.MessageContext) Lookup(org.compiere.model.Lookup) Properties(java.util.Properties) Context(javax.ws.rs.core.Context) OutputFields(org.idempiere.adInterface.x10.OutputFields) ImmutablePOCache(org.idempiere.cache.ImmutablePOCache) StandardResponse(org.idempiere.adInterface.x10.StandardResponse) Timestamp(java.sql.Timestamp) Resource(javax.annotation.Resource) ServiceQuery(org.adempiere.base.ServiceQuery) MUser(org.compiere.model.MUser) IdempiereServiceFault(org.idempiere.webservices.fault.IdempiereServiceFault) List(java.util.List) MWebServiceType(org.idempiere.webservices.model.MWebServiceType) AdempiereException(org.adempiere.exceptions.AdempiereException) KeyNamePair(org.compiere.util.KeyNamePair) QName(javax.xml.namespace.QName) PO(org.compiere.model.PO) MWebServiceType(org.idempiere.webservices.model.MWebServiceType) Query(org.compiere.model.Query) ServiceQuery(org.adempiere.base.ServiceQuery) X_WS_WebServiceMethod(org.idempiere.webservices.model.X_WS_WebServiceMethod)

Example 5 with MWebServiceType

use of org.idempiere.webservices.model.MWebServiceType in project idempiere by idempiere.

the class ModelADServiceImpl method validateParameter.

private String validateParameter(String parameterName, String string) {
    MWebServiceType m_webservicetype = getWebServiceType();
    X_WS_WebService_Para para = m_webservicetype.getParameter(parameterName);
    if (para == null && (string == null || string.length() == 0))
        // if parameter not configured but didn't receive value (optional param)
        return null;
    if (para == null)
        throw new IdempiereServiceFault("Web service type " + m_webservicetype.getValue() + ": invalid parameter " + parameterName, new QName("validateParameter"));
    if (X_WS_WebService_Para.PARAMETERTYPE_Constant.equals(para.getParameterType())) {
        if (string == null || string.length() == 0) {
            if (log.isLoggable(Level.INFO))
                log.log(Level.INFO, "Web service type " + m_webservicetype.getValue() + ": constant parameter " + parameterName + " set to " + para.getConstantValue());
            return para.getConstantValue();
        } else if (!para.getConstantValue().equals(string)) {
            log.log(Level.WARNING, "Web service type " + m_webservicetype.getValue() + ": constant parameter " + parameterName + " changed to " + para.getConstantValue());
            return para.getConstantValue();
        }
    }
    // it must be parameter FREE
    return string;
}
Also used : MWebServiceType(org.idempiere.webservices.model.MWebServiceType) IdempiereServiceFault(org.idempiere.webservices.fault.IdempiereServiceFault) QName(javax.xml.namespace.QName) X_WS_WebService_Para(org.idempiere.webservices.model.X_WS_WebService_Para)

Aggregations

MWebServiceType (org.idempiere.webservices.model.MWebServiceType)10 IdempiereServiceFault (org.idempiere.webservices.fault.IdempiereServiceFault)9 Properties (java.util.Properties)8 ADLoginRequest (org.idempiere.adInterface.x10.ADLoginRequest)8 MTable (org.compiere.model.MTable)7 PO (org.compiere.model.PO)7 POInfo (org.compiere.model.POInfo)7 Trx (org.compiere.util.Trx)6 DataField (org.idempiere.adInterface.x10.DataField)6 DataRow (org.idempiere.adInterface.x10.DataRow)6 StandardResponse (org.idempiere.adInterface.x10.StandardResponse)6 StandardResponseDocument (org.idempiere.adInterface.x10.StandardResponseDocument)6 QName (javax.xml.namespace.QName)5 ModelCRUD (org.idempiere.adInterface.x10.ModelCRUD)5 SQLException (java.sql.SQLException)4 ArrayList (java.util.ArrayList)4 XmlValueOutOfRangeException (org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException)4 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 MRole (org.compiere.model.MRole)2