WSO2管理服务BAMMediatorConfigAdmin

时间:2013-05-20 21:14:02

标签: web-services admin wso2

我正在尝试使用Admin Web服务添加BAM服务器配置文件(在ESB服务器下)。我没有看到在作为独立程序执行时抛出任何错误但是没有添加配置文件。请告知以下步骤是否正确 -

  1. 通过连接到“AuthenticationAdmin”网址
  2. 获取管理员Cookie
  3. 使用“BAMMediatorConfigAdmin”WSDL中的wsdl2java创建存根
  4. String bamcepServerProfileServiceURL = Constant.SERVICE_URL +“BAMMediatorConfigAdmin”;

    BAMMediatorConfigAdminStub stub = new BAMMediatorConfigAdminStub(bamcepServerProfileServiceURL);

  5.                 ServiceClient client = stub._getServiceClient();
            Options option = client.getOptions();
            option.setManageSession(true);
            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, adminCookie);
    
  6.                 BAMMediatorConfigAdminStub.BamServerConfig bamConfig = new                      BAMMediatorConfigAdminStub.BamServerConfig();
            bamConfig.setUsername("admin");
            bamConfig.setPassword("admin");
            bamConfig.setLoadbalanced(false);
            bamConfig.setSecurity(true);
            bamConfig.setIp("localhost");
            bamConfig.setAuthenticationPort("7611");
    
            BAMMediatorConfigAdminStub.SaveBamServerConfig config = new BAMMediatorConfigAdminStub.SaveBamServerConfig();
            config.setBamServerConfig(bamConfig);
    
            stub.saveBamServerConfig(config);