package com.yihu.jw.utils.Pkis;

public class PKIServiceProxy implements PKIService_PortType {
  private String _endpoint = null;
  private PKIService_PortType pKIService_PortType = null;
  
  public PKIServiceProxy() {
    _initPKIServiceProxy();
  }
  
  public PKIServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initPKIServiceProxy();
  }
  
  private void _initPKIServiceProxy() {
    try {
      pKIService_PortType = (new PKIService_ServiceLocator()).getPKIServiceImplPort();
      if (pKIService_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)pKIService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)pKIService_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (pKIService_PortType != null)
      ((javax.xml.rpc.Stub)pKIService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public PKIService_PortType getPKIService_PortType() {
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType;
  }
  
  public String SOF_LoginAuthentication(String certData, String inData, String signData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_LoginAuthentication(certData, inData, signData);
  }
  
  public String SOF_SignDataWithExtraInfo(String idCardNo, String inData, String extInfo) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_SignDataWithExtraInfo(idCardNo, inData, extInfo);
  }
  
  public String SOF_SignData(String idCardNo, String inData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_SignData(idCardNo, inData);
  }
  
  public String SOF_VerifySignedData(String certData, String inData, String signData) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_VerifySignedData(certData, inData, signData);
  }
  
  public String SOF_LoginWithAccountInfo(String sys, String accountType, String account, String password) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_LoginWithAccountInfo(sys, accountType, account, password);
  }
  
  public String SOF_GetCertInfoByType(String certData, int type) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GetCertInfoByType(certData, type);
  }
  
  public String SOF_GetCertInfoByOid(String certData, String oid) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GetCertInfoByOid(certData, oid);
  }
  
  public String SOF_GenRandom(int len) throws java.rmi.RemoteException{
    if (pKIService_PortType == null)
      _initPKIServiceProxy();
    return pKIService_PortType.SOF_GenRandom(len);
  }
  
  
}