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

Page 870

Advertising
background image

860

Brocade Virtual ADX XML API Programmer’s Guide

53-1003248-01

Example: Unbinding a real server from a VIP

B

//

// Description: Called by the SOAP client class library, GetWebRequest

will

// 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: SlbService

//

// Description: This class is being derived from AdcSysInfo class which is the

// autogenerated class after adding slb_service.WSDL

//

// Parameters: -

//

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

public class SlbService : AdcSlb

{

private String m_HeaderName;

private String m_HeaderValue;

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

// Name: GetWebRequest

//

// Description: Called by the SOAP client class library, GetWebRequest

will

Advertising