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

Page 871

Advertising
background image

Brocade Virtual ADX XML API Programmer’s Guide

861

53-1003248-01

Example: Unbinding a real server from a VIP

B

// add to the underlying request used by the SOAP client when

// making the web method call

//

// Parameters: Uri - the webservice url

//

/////////////////////////////////////////////////////////////////////////////

protected override WebRequest GetWebRequest(Uri uri)

{

// call the base class to get the underlying WebRequest object

HttpWebRequest req = (HttpWebRequest)base.GetWebRequest(uri);

if (null != this.m_HeaderName)

{

// set the header

req.Headers.Add(this.m_HeaderName, this.m_HeaderValue);

}

// return the WebRequest to the caller

return (WebRequest)req;

}

/////////////////////////////////////////////////////////////////////////////

// Name: SetRequestHeader

//

// Description: Sets the header name and value that GetWebRequest will add

to

// the authorization header to the outgoing webrequest.

//

// Parameters: headerName - The Authorization tag. headerValue - the

encrypted

// username and password

/////////////////////////////////////////////////////////////////////////////

public void SetRequestHeader(String headerName, String headerValue)

{

this.m_HeaderName = headerName;

this.m_HeaderValue = headerValue;

}

}

/////////////////////////////////////////////////////////////////////////////

// Name: Utils

//

// Description: Utils class is the utility class with singleton functionality

// which contains common functionalities which is being used in

// more than one class

//

// Parameters: -

//

/////////////////////////////////////////////////////////////////////////////

public class Utils

{

private Utils() { }

~Utils() { }

private static Utils m_Utils = null;

public SlbService m_SLBService = null;

public SysService m_SYSService = null;

private static StreamWriter m_StreamWriter = null;

private static FileStream m_FileStream = null;

/////////////////////////////////////////////////////////////////////////////

// Name: GetUtilsInstance

Advertising