Edit Content (SOAP)

Overview

The EditProgram SOAP method allows you to programmatically edit a content record on 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
ID Integer Y The unique content ID for the program
program_code String Y 64 Unique ID for the program
program String Y 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 Y 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 EditProgram() 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.EditProgram(
    15,
    "M8",
    "Example TBD Program",
    "S8",
    "8",
    "This is an example TBD program added via SOAP.",
    "2009-12-31T14:39:23-04:00",
    "2002-12-01T14: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

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:

 

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 EditProgram() method of the * TelVue Corporation SOAP Web Service. */ try { $service = new SoapClient('http://192.168.1.150:3000/program_service/wsdl'); $result = $service->EditProgram(
    15,
    '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. <strong-->' . $result[1] . '
 
');
  }
} catch (SoapFault $fault) {
  trigger_error(
    "SOAP Fault: (
        faultcode: {$fault-&gt;faultcode}, faultstring: {$fault-&gt;faultstring}
    )",
    E_USER_ERROR
  );
}
?&gt;

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 Edit 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 Content file not found for ID: id A valid content file ID needs to be specified
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.
Facebooktwittergoogle_pluslinkedin