Search in sources :

Example 1 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class RaService method queryCertBySerialNumber.

/**
 * 通过序列号查询证书
 *
 * @Title: unsuspendCert
 * @Description: TODO(恢复证书 )
 * @param serialNumber
 *            证书序列号
 * @return JSONObject 返回结果信息
 * @throws JSONException
 */
public JSONObject queryCertBySerialNumber(String serialNumber) throws JSONException {
    JSONObject ret = new JSONObject();
    String json = "";
    if (StringUtils.isBlank(serialNumber)) {
        ret.put("code", "10010106");
        ret.put("msg", errorCode.getErrorCode().get(10010106));
        return ret;
    }
    try {
        if (CERT_ISKMC != null) {
            json = "{'certKmcReq2':'" + (CERT_ISKMC.equals("false") ? "" : "kmcClientVersion=20150130") + "','certValidity':'" + CERT_REQ_CHALLENGE + "'}";
        }
        UserAPIServicePortTypeProxy proxy = axisUtil.getProxyNow();
        QueryCertResult result = proxy.queryCertBySerialNumber(serialNumber, ACCOUNT_HASH, json);
        ret.put("code", "0");
        ret.put("msg", "");
        ret.put("result", result);
    } catch (Exception e) {
        ret.put("code", "20010101");
        ret.put("msg", errorCode.getErrorCode().get(20010101) + ":" + e.getMessage());
        return ret;
    }
    return ret;
}
Also used : JSONObject(org.json.JSONObject) UserAPIServicePortTypeProxy(com.liumapp.digitalsign.test.ca.tianwei.proxy.UserAPIServicePortTypeProxy) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult) JSONException(org.json.JSONException)

Example 2 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class RaService method queryCerts.

/**
 * 查询个人用户证书信息
 *
 * @Title: queryCerts
 * @Description: TODO(查询个人用户证书信息)
 * @param userInfo
 *            证书用户信息
 * @param certInfo
 *            证书信息
 * @param currentPage
 *            页数[从第几页开始查询],若为空,默认从第一页开始
 * @parm pageSize 每页显示的数据条数
 * @return QueryCertResult 证书对象
 */
public QueryCertResult queryCerts(UserInfo userInfo, CertInfo certInfo, int currentPage, int pageSize) {
    try {
        UserAPIServicePortTypeProxy proxy = axisUtil.getProxyNow();
        if (null != certInfo.getCertSerialNumber() && !"".equals(certInfo.getCertSerialNumber())) {
            QueryCertResult quertResult = proxy.queryCertBySerialNumber(certInfo.getCertSerialNumber().trim(), ACCOUNT_HASH.toString().trim(), null);
            return quertResult;
        }
        if (null != certInfo.getCertNotAfter() && !"".equals(certInfo.getCertNotAfter())) {
            String notAfterTime = DateUtil.convertBeginTimeToDBDate(certInfo.getCertNotAfter());
            certInfo.setCertNotAfter(notAfterTime);
        }
        if (null != certInfo.getCertNotBefore() && !"".equals(certInfo.getCertNotBefore())) {
            String notAfterTime = DateUtil.convertBeginTimeToDBDate(certInfo.getCertNotBefore());
            certInfo.setCertNotAfter(notAfterTime);
        }
        if (null == certInfo.getCertStatus() || "".equals(certInfo.getCertStatus())) {
            certInfo.setCertStatus("ALL");
        }
        QueryCertResult queryResult = proxy.queryCerts(userInfo, certInfo, currentPage - 1, pageSize, "selectValidCert", null, null, ACCOUNT_HASH);
        return queryResult;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
Also used : UserAPIServicePortTypeProxy(com.liumapp.digitalsign.test.ca.tianwei.proxy.UserAPIServicePortTypeProxy) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult) JSONException(org.json.JSONException)

Example 3 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class UserAPIServiceSoapBindingStub method queryCertBySerialNumber.

public QueryCertResult queryCertBySerialNumber(String serialNumber, String accountHash, String json) throws java.rmi.RemoteException, RaServiceUnavailable {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[10]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    _call.setEncodingStyle(null);
    _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
    _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new QName("http://service.ra.tca.topca.cn/", "queryCertBySerialNumber"));
    setRequestHeaders(_call);
    setAttachments(_call);
    try {
        java.lang.Object _resp = _call.invoke(new java.lang.Object[] { serialNumber, accountHash, json });
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException) _resp;
        } else {
            extractAttachments(_call);
            try {
                return (QueryCertResult) _resp;
            } catch (java.lang.Exception _exception) {
                return (QueryCertResult) org.apache.axis.utils.JavaUtils.convert(_resp, QueryCertResult.class);
            }
        }
    } catch (org.apache.axis.AxisFault axisFaultException) {
        if (axisFaultException.detail != null) {
            if (axisFaultException.detail instanceof java.rmi.RemoteException) {
                throw (java.rmi.RemoteException) axisFaultException.detail;
            }
            if (axisFaultException.detail instanceof RaServiceUnavailable) {
                throw (RaServiceUnavailable) axisFaultException.detail;
            }
        }
        throw axisFaultException;
    }
}
Also used : QName(javax.xml.namespace.QName) RaServiceUnavailable(com.liumapp.digitalsign.test.ca.tianwei.error.RaServiceUnavailable) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult)

Example 4 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class UserAPIServiceSoapBindingStub method queryCerts.

public QueryCertResult queryCerts(UserInfo userInfo, CertInfo certInfo, int pageIndex, int pageSize, String sqlTemplateFileName, String nextResultTag, String totalTag, String accountHash) throws java.rmi.RemoteException, RaServiceUnavailable {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[4]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    _call.setEncodingStyle(null);
    _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
    _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new QName("http://service.ra.tca.topca.cn/", "queryCerts"));
    setRequestHeaders(_call);
    setAttachments(_call);
    try {
        java.lang.Object _resp = _call.invoke(new java.lang.Object[] { userInfo, certInfo, new java.lang.Integer(pageIndex), new java.lang.Integer(pageSize), sqlTemplateFileName, nextResultTag, totalTag, accountHash });
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException) _resp;
        } else {
            extractAttachments(_call);
            try {
                return (QueryCertResult) _resp;
            } catch (java.lang.Exception _exception) {
                return (QueryCertResult) org.apache.axis.utils.JavaUtils.convert(_resp, QueryCertResult.class);
            }
        }
    } catch (org.apache.axis.AxisFault axisFaultException) {
        if (axisFaultException.detail != null) {
            if (axisFaultException.detail instanceof java.rmi.RemoteException) {
                throw (java.rmi.RemoteException) axisFaultException.detail;
            }
            if (axisFaultException.detail instanceof RaServiceUnavailable) {
                throw (RaServiceUnavailable) axisFaultException.detail;
            }
        }
        throw axisFaultException;
    }
}
Also used : QName(javax.xml.namespace.QName) RaServiceUnavailable(com.liumapp.digitalsign.test.ca.tianwei.error.RaServiceUnavailable) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult)

Example 5 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class UserAPIServiceSoapBindingStub method queryCertByCertId.

public QueryCertResult queryCertByCertId(int certId, String accountHash, String json) throws java.rmi.RemoteException, RaServiceUnavailable {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[0]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    _call.setEncodingStyle(null);
    _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
    _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new QName("http://service.ra.tca.topca.cn/", "queryCertByCertId"));
    setRequestHeaders(_call);
    setAttachments(_call);
    try {
        java.lang.Object _resp = _call.invoke(new java.lang.Object[] { new java.lang.Integer(certId), accountHash, json });
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException) _resp;
        } else {
            extractAttachments(_call);
            try {
                return (QueryCertResult) _resp;
            } catch (java.lang.Exception _exception) {
                return (QueryCertResult) org.apache.axis.utils.JavaUtils.convert(_resp, QueryCertResult.class);
            }
        }
    } catch (org.apache.axis.AxisFault axisFaultException) {
        if (axisFaultException.detail != null) {
            if (axisFaultException.detail instanceof java.rmi.RemoteException) {
                throw (java.rmi.RemoteException) axisFaultException.detail;
            }
            if (axisFaultException.detail instanceof RaServiceUnavailable) {
                throw (RaServiceUnavailable) axisFaultException.detail;
            }
        }
        throw axisFaultException;
    }
}
Also used : QName(javax.xml.namespace.QName) RaServiceUnavailable(com.liumapp.digitalsign.test.ca.tianwei.error.RaServiceUnavailable) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult)

Aggregations

QueryCertResult (com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult)6 RaServiceUnavailable (com.liumapp.digitalsign.test.ca.tianwei.error.RaServiceUnavailable)3 UserAPIServicePortTypeProxy (com.liumapp.digitalsign.test.ca.tianwei.proxy.UserAPIServicePortTypeProxy)3 QName (javax.xml.namespace.QName)3 JSONException (org.json.JSONException)3 JSONObject (org.json.JSONObject)2