EOF;
echo $str;
}
function display_new_form($type) {
$str = <<
Service Type
EOF;
if ($type == 'BS') {
$str .= << Business Service
Order Processing Service
EOF;
} else if ($type == 'OPS') {
$str .= << Business Service
Order Processing Service
EOF;
}
$str .= <<
Service Name
Service URL
Use secure messaging
EOF;
echo $str;
}
function get_proxy() {
global $class_map;
$client = new WSClient(array("wsdl" =>"../resources/wsdl/config_svc.wsdl",
"classmap" => $class_map));
$proxy = $client->getProxy();
return $proxy;
}
function display_bs_ops_conf_form() {
$proxy = get_proxy();
$input = new GetClientConfig();
$input->client = new ClientConfigRequest();
$input->client->ClientName = "PHP_CLIENT";
$response = $proxy->GetClientConfig($input);
$bs = $response->GetClientConfigResult->BSName;
$input = new GetBSConfig();
$input->bs = new BSConfigRequest();
$input->bs->BSName = $bs;
$response = $proxy->GetBSConfig($input);
$ops = $response->GetBSConfigResult->OPSName;
$str = <<
Business Service
';
echo $str;
$str = <<
Order Processing Service
';
echo $str;
$str = <<
EOF;
echo $str;
}
function update_clienttobs($bs) {
$proxy = get_proxy();
$input = new SetClientToBS();
$input->clientConfig = new ClientToBS();
$input->clientConfig->Bs = $bs;
$input->clientConfig->Client = "PHP_CLIENT";
$proxy->SetClientToBS($input);
}
function update_bstoops($ops, $bs) {
$proxy = get_proxy();
$input = new SetBSToOPS();
$input->bsConfig = new BSToOPS();
$input->bsConfig->Bs = $bs;
$input->bsConfig->Ops = $ops;
$proxy->SetBSToOPS($input);
}
function update_service($name, $url, $sec) {
$proxy = get_proxy();
$input = new SetServiceLocation();
$input->location = new ServiceLocation();
$input->location->Sec = $sec ? "true" : "false";
$input->location->ServiceName = $name;
$input->location->ServiceURL = $url;
$proxy->SetServiceLocation($input);
}
function update_params($post, $type) {
if ($type == "basic") {
update_clienttobs($post['bs']);
update_bstoops($post['ops'], $post['bs']);
} else if ($type == "advanced") {
$bssec = (isset($_POST['bs_sec'])) ? true : false;
$opssec = (isset($_POST['ops_sec'])) ? true : false;
update_clienttobs($post['bs_name']);
update_bstoops($post['bs_name'], $post['ops_name']);
update_service($post['bs_name'], $post['bs_url'], $bssec);
update_service($post['ops_name'], $post['ops_url'], $opssec);
} else if ($type == "addnew") {
if (isset($post['service_name']) &&
isset($post['service_url']) ) {
update_service($post['service_name'], $post['service_url'], $post['service_sec']);
}
}
}
function restore_defaults() {
$post = array('bs' => 'DOTNET_BS', 'ops' => 'DOTNET_OPS');
update_params($post, "basic");
}
function display_advanced_config_form() {
$proxy = get_proxy();
$input = new GetClientConfig();
$input->client = new ClientConfigRequest();
$input->client->ClientName = "PHP_CLIENT";
$response = $proxy->GetClientConfig($input);
$bs = $response->GetClientConfigResult->BSName;
$input = new GetBSConfig();
$input->bs = new BSConfigRequest();
$input->bs->BSName = $bs;
$response = $proxy->GetBSConfig($input);
$ops = $response->GetBSConfigResult->OPSName;
$input = new GetBSLocations();
$response = $proxy->GetBSLocations($input);
$bs_list = array();
for ($i = 0; $i < count($response->GetBSLocationsResult->ServiceLocation); $i++) {
$bs_list[$response->GetBSLocationsResult->ServiceLocation[$i]->ServiceName] =
$response->GetBSLocationsResult->ServiceLocation[$i]->ServiceURL .
'##' .
$response->GetBSLocationsResult->ServiceLocation[$i]->Sec;
}
$input = new GetOPSLocations();
$response = $proxy->GetOPSLocations($input);
$ops_list = array();
for ($i = 0; $i < count($response->GetOPSLocationsResult->ServiceLocation); $i++) {
$ops_list[$response->GetOPSLocationsResult->ServiceLocation[$i]->ServiceName] =
$response->GetOPSLocationsResult->ServiceLocation[$i]->ServiceURL .
'##' .
$response->GetOPSLocationsResult->ServiceLocation[$i]->Sec;
}
// business service options
$str = <<