0

是否可以使用身份验证证书连接到 WSO2 (CEP) 管理服务?

https://localhost:9443/services/UserAdmin?wsdl

如果是,那么如何做到这一点?

4

1 回答 1

1

所有 WSO2 产品都可以访问管理服务 API。您必须使用产品使用的公共证书才能在 SSL 上进行通信。

您可以参考以下示例

import org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException;  
import org.wso2.carbon.authenticator.stub.LogoutAuthenticationExceptionException;  
import org.wso2.carbon.service.mgt.stub.types.carbon.ServiceMetaData;  
import org.wso2.carbon.service.mgt.stub.types.carbon.ServiceMetaDataWrapper;  

import java.rmi.RemoteException;  

public class ListServices {  
  public static void main(String[] args)  
      throws RemoteException, LoginAuthenticationExceptionException,  
          LogoutAuthenticationExceptionException {  
    System.setProperty("javax.net.ssl.trustStore", "$CEP_HOME/repository/resources/security/wso2carbon.jks");  
    System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");  
    System.setProperty("javax.net.ssl.trustStoreType", "JKS");  
    String backEndUrl = "https://localhost:9443";  

    LoginAdminServiceClient login = new LoginAdminServiceClient(backEndUrl);  
    String session = login.authenticate("admin", "admin");  
    ServiceAdminClient serviceAdminClient = new ServiceAdminClient(backEndUrl, session);  
    ServiceMetaDataWrapper serviceList = serviceAdminClient.listServices();  
    System.out.println("Service Names:");  
    for (ServiceMetaData serviceData : serviceList.getServices()) {  
      System.out.println(serviceData.getName());  
    }  

    login.logOut();  
  }  
}

有关更多信息,请查看此处

于 2015-06-23T07:59:39.570 回答