Please note: The SOAP APIs have been discontinued in favor of more robust REST APIs as of version 6.0.
Overview
The AddProgram SOAP method allows you to programmatically add a content record to your TelVue Princeton™ server.
You need to have installed:
- A Programming Language (C#, Java, PHP, Ruby, etc.)
- A SOAP Library
- A WSDL Library
Request URL
http://myserver/program_service/wsdl
Substitute the hostname, domain, or IP Address of your server instead of myserver
.
Parameters
Parameter | Type | Required | Max Length | Description |
---|---|---|---|---|
program_code |
String |
![]() |
64 | Unique ID for the program |
program |
String |
![]() |
254 | Title of the program |
episode |
String |
254 | Title of the episode | |
episode_code |
String |
64 | Unique episode ID | |
description |
String |
4000 | Description of the program | |
delete_datetime |
DateTime |
Scheduled deletion date. Must be in the form, 2009-12-31 14:39:23-04:00 . Program will be auto-deleted at this point in the future. |
||
import_datetime |
DateTime |
Date the file is expected to be imported. Must be in the form, 2009-12-31 14:39:23-04:00 . |
||
expected_duration |
Integer |
Expected duration of the program in seconds. | ||
expected_filename |
String |
128 | Expected filename of the program. | |
contributor |
String |
64 | Name of the contributor. | |
location |
String |
32 | Location of the program. | |
username |
String |
![]() |
30 | The owner of the content. This must be a valid username in the system, as if that user was logged in and added the program manually. |
Code Examples
Ruby
Copy the Ruby script below to your system. Substitute the IP address of your server instead of 192.168.1.150.
###########################
# Example Ruby script to call the AddProgram() method of TelVue Corporation
# SOAP Web Service.
###########################
require 'soap/wsdlDriver'
begin
service=SOAP::WSDLDriverFactory.new(
"http://192.168.1.150/program_service/wsdl"
).create_rpc_driver
response_message = service.AddProgram(
"M8",
"Example TBD Program",
"S8",
"8",
"This is an example TBD program added via SOAP.",
"2009-12-31 14:39:23-04:00",
"2009-12-01 14:39:23-04:00",
80,
"example_tbd.mpg",
"WEBUS Promo",
"Mt. Laurel, NJ",
"psgadmin"
)
puts response_message
rescue StandardError => e
puts e.class
puts e.message
puts e.backtrace
end
end
PHP
You must have the PHP-Soap library installed. PHP-Soap is bundled by default with most PHP installations, including popular all-in-one installers like XAMPP for Windows and Linux. To find out if PHP-Soap in installed, create a file in your web project called info.php with these 3 lines in it:
< ?php phpinfo(); ?>
Browse it in a web browser. Perform a Find (Ctrl-F) for the word “soap”. You should see the PHP-Soap extensions installed.
If you do not have PHP-Soap installed, outlining how to do so is beyond the scope of this article. There are plenty of instructions online.
Change the IP Address and data in these example accordingly.
< ?php /** * Example PHP script to call the AddProgram() method of the * TelVue Corporation SOAP Web Service. */ try { $service = new SoapClient('http://192.168.1.150/program_service/wsdl'); $result = $service->AddProgram(
'M8',
'Example TBD Program',
'S8',
'8',
'This is an example TBD added via soap.',
new SoapVar('', XSD_ANYXML), // NULL
'2008-10-21 14:39:23-04:00',
80,
'exampled_tbd.mpg',
'Poor Steve',
'Princeton, NJ',
'psgadmin'
);
if ($result[0] == 'SUCCEEDED') {
echo('
Success.
‘); } else { echo(‘
Failed. ‘ . $result[1] . ‘
‘); } } catch (SoapFault $fault) { trigger_error( “SOAP Fault: ( faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring} )”, E_USER_ERROR ); } ?>
Note that Delete Date, in the above example, shows how to insert a NULL into the database for that column.
Returns
Success
HTTP Code | Response String | Description |
---|---|---|
200 |
SUCCEEDED |
Add operation succeeded. |
Failure
HTTP Code | Response String | Description |
---|---|---|
200 |
FAILED |
Add operation failed. |
200 |
User is not authorized: username |
Username was not found in the system. |
200 |
Invalid import datetime entered: import_datetime |
Import datetime was not in a valid format. It must be in the form, 2009-12-31 14:39:23-04:00 |
200 |
Invalid delete datetime entered: delete_datetime |
Delete datetime was not in a valid format. It must be in the form, 2009-12-31 14:39:23-04:00 . |