beautypg.com

Brocade Virtual ADX XML API Programmer’s Guide (Supporting ADX v03.1.00) User Manual

Page 864

background image

854

Brocade Virtual ADX XML API Programmer’s Guide

53-1003248-01

Example: Unbinding a real server from a VIP

B

import com.brocade.slb.connector.webservicesapi.RequestHeader_datatype;

import com.brocade.slb.connector.webservicesapi.RuntimeFault_datatype;

import com.brocade.slb.connector.webservicesapi.Server;

import com.brocade.slb.connector.webservicesapi.ServerPort;

import

com.brocade.slb.connector.webservicesapi.UnbindRealServerPortFromVipPort_datatype

;

import com.brocade.slb.connector.webservicesapi.VirtualServerConfiguration;

import com.brocade.slb.connector.webservicesapi.WriteConfig_datatype;

public class Usecase2 {

private AdcSlbServicePortType slbService;

private AdcSlbLocator slbLocator;

AdcSysInfoServicePortType sysService;

AdcSysInfoLocator sysLocator;

String hostIP = null;

int webServicePort = 0;

String protocol = null;

String username = null;

String password = null;

String realServerName = null;

String realServerIp = null;

String realServerPort = null;

String virtualServerName = null;

String virtualServerIp = null;

String virtualServerPort = null;

// Initialize Test Parameters

{

// Device parameters

hostIP = "10.37.53.198";

webServicePort = 80;

protocol = "http";

username = "admin";

password = "brocade";

// Create Real server Parameters

realServerName = "rs5";

realServerIp = "192.168.100.5";

// Create Real server port Parameters

realServerPort = "http";

// Create Virtual server Parameters

virtualServerName = "vs5";

virtualServerIp = "193.168.100.5";

// Create Virtual server port Parameters

virtualServerPort = "http";

}

/**

* Initializes SYS Service

*

* @throws MalformedURLException

* @throws ServiceException

*/

public void initSysService() throws MalformedURLException, ServiceException {

sysLocator = new AdcSysInfoLocator();

URL deviceUrl = new URL(protocol, hostIP, webServicePort, "/WS/SYS");

sysService = sysLocator.getAdcSysInfoSOAP(deviceUrl);

Stub stub = (javax.xml.rpc.Stub) sysService;

stub._setProperty(Stub.USERNAME_PROPERTY, username);

stub._setProperty(Stub.PASSWORD_PROPERTY, password);

stub._setProperty(MessageContext.HTTP_TRANSPORT_VERSION,