Programmer's Guide (Supporting ADX v03.1.00) Manual

818 Brocade Virtual ADX XML API Programmer’s Guide
53-1003248-01
Example: Adding and binding a real server and a VIP
B
# Make the SOAP Call and store the XML result in a variable
# Response is stored in "$xml_result" as XML. Further action can be taken based on
the Response Content.
$xml_result =
$slbsoap->call('urn:createVirtualServerPortWithConfiguration',@slbsoap_body,$slbs
oap_header);
# Get the elapsed time (Time taken for the SOAP Response to arrive after the
request was sent)
$response_time = &get_elapsed_time($request_time);
# Write the Time taken to the Test Case LOG File
print LOG "SOAP Response Time for Creating the Virtual Server Port:
$response_time\n";
print LOG "===== Operation Complete =====\n\n";
#### Bind the Real Server Port to the Virtual Server Port ####
##############################################################
# Build the SOAP Request Message with the XML Context and Header
@slbsoap_body = (name('realServerPort')->value([
name('ServerPortSequence')->value([
name('port')->value([
name('NameOrNumber')->value('http')
]),
name('srvr')->value([
name('Name')->value('RealServer-001')
])
])
]),
name('virtualServerPort')->value([
name('port')->value([
name('NameOrNumber')->value('http')
]),
name('srvr')->value([
name('Name')->value('VirtualServer-001')
])
]));
print LOG "Binding Real Server Port to Virtual Server Port\n";
# Note the time before making a SOAP Request
$request_time = &start_timer;
# Make the SOAP Call and store the XML result in a variable
# Response is stored in "$xml_result" as XML. Further action can be taken based on
the Response Content.
$xml_result =
$slbsoap->call('urn:bindRealServerPortsToVipPort',@slbsoap_body,$slbsoap_header);
# Get the elapsed time (Time taken for the SOAP Response to arrive after the
request was sent)
$response_time = &get_elapsed_time($request_time);
# Write the Time taken to the Test Case LOG File
print LOG "SOAP Response Time to Bind the Real Server Port to the Virtual Server
Port: $response_time\n";
print LOG "===== Operation Complete =====\n\n";
#### Write Configuration in Memory to the Startup Config File ####
##################################################################
print LOG "Writing Configuration in Memory to Startup Config\n";