Here is our VB Client
TestClient.vb
Imports:
Imports MetaSoftClientVB.MetaSoftService
Setup class and variables:
Public Class TestClient
Dim obj As New MetasoftTVAService
Dim res(1) As String
Dim res1 As New get_Data_ResultType()
GetData Method
Setup method and variables:
Private Sub bnGetData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnGetData.Click
Dim getDataType As New get_DataType()
Dim queryConstraints As New get_DataTypeQueryConstraints()
Dim predicateBagType As New PredicateBagType()
Dim binaryPredicateType As New BinaryPredicateType()
Put in field name and value:
Dim qname = New System.Xml.XmlQualifiedName("Title")
binaryPredicateType.fieldID = qname
binaryPredicateType.fieldValue = "Pop Songs"
binaryPredicateType.test = BinaryPredicateTestType.equals
Put it in the query constraint objects:
Dim binaryPredicateTypes(1) As BinaryPredicateType
binaryPredicateTypes(0) = binaryPredicateType
predicateBagType.Items = binaryPredicateTypes
queryConstraints.Item = predicateBagType
getDataType.QueryConstraints = queryConstraints
Put in the tables that you are querying:
Dim requestTable As New RequestedTablesTypeTable()
requestTable.type = RequestedTablesTypeTableType.ProgramInformationTable
Dim requestTables(1) As RequestedTablesTypeTable
requestTables(0) = requestTable
getDataType.RequestedTables = requestTables
Submit the query:
res1 = obj.getData(getDataType)
Submit Method
Setup constructor:
Private Sub bnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnSubmit.Click
Initiate the necessary objects to construct your TVAMain Extended Object:
Dim mainType As New ExtendedTVAMainType()
Dim prgDesc As New ProgramDescriptionType()
Dim prgInfoTable As New ProgramInformationTableType()
Put in the content service provider's name, program ID (CRID if there is one, if not leave blank and one will be assigned):
prgInfoTable.metadataOriginIDRef = "BBC"
Dim prgInfo As New ProgramInformationType()
prgInfo.programId = "crid:
Create a Title object and Array:
Dim title As New TitleType()
title.Value = "Pop Songs"
Dim titles(1) As TitleType
titles(0) = title
Make a synopsis object and Array:
Dim SynopsisType As New SynopsisType()
SynopsisType.Value = "Music"
SynopsisType.length = SynopsisLengthType.short
Dim synopsisTypes(1) As SynopsisType
synopsisTypes(0) = SynopsisType
Create a term object and Genre object and fill them in:
Dim termNameType1 As New TermNameType()
termNameType1.Value = "Non-Fiction/Information"
Dim GenreType As New GenreType()
GenreType.href = "urn:tva:metadata:cs:ContentCS:2005:3.8"
GenreType.Name = TermNameType
Create a BasicContentDescrption object and fill in the info:
Dim basicContent As New BasicContentDescriptionType()
Put in the necessary attributes (optional):
Dim AVAttributesType As New AVAttributesType()
AVAttributesType.FileSize = 3
Dim AudioAttributesType As New AudioAttributesType1()
AudioAttributesType.NumOfChannels = 34
Dim audioAttributesTypes(1) As AudioAttributesType1
audioAttributesTypes(0) = AudioAttributesType
AVAttributesType.AudioAttributes = audioAttributesTypes
prgInfo.AVAttributes = AVAttributesType
Put all the data in the correct objects:
prgInfo.BasicDescription = basicContent
Dim prgInfos(1) As ProgramInformationType
prgInfos(0) = prgInfo
prgInfoTable.ProgramInformation = prgInfos
prgDesc.ProgramInformationTable = prgInfoTable
mainType.ProgramDescription = prgDesc
Submit the data:
res = obj.submitData(mainType)