Latest post Wed, Jun 17 2015 7:32 PM by xudon. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Thu, Sep 25 2014 8:37 PM

    • xudon
    • Not Ranked
    • Joined on Tue, Apr 15 2014
    • Posts 14
    • Points 180

    Set attributes with web services

    Hi,

    I have a couple of questions with set attributes for assets.

    First, what is the syntax to set attributes in dotnet. What I put in list below gave me error in run time.

    Dim port As New AssetsPortTypeClient()

            Dim creds As New InterplayAssetsWS.UserCredentialsType()

            creds.Username = ""

            creds.Password = "l"

            Dim param As New SetAttributesType()

            param.InterplayURIs(0) = "mobid..."
            param.Attributes(0).Group = "SYSTEM"
            param.Attributes(0).Name = "END"
            param.Attributes(0).Value = "04:01:59:14"


            Try
                Dim response As SetAttributesResponseType = port.SetAttributes(creds, param)

                If Not IsNothing(Response.Errors) Then
                    lblInfo.Text = Response.Errors.ToString

                Else

                    lblInfo.Text = ""

                End If
            Catch ex As Exception
                lblInfo.Text = ex.Message.ToString
            End Try

    Second, I know that I should not set SYSTEM attributes, but this asset is subclip I created in my program and wanted to fix the system.end timecode.  Can I do it?

    As always thanks a lot for looking into this.

    Don

    Filed under: ,
  • Thu, Sep 25 2014 9:38 PM In reply to

    • robg
    • Top 500 Contributor
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Set attributes with web services

    Don,

    The runtime error can be fixed by allocating the param.InterplayURIs and paramAttribute arrays (see the source code below).

    But you will find that this will yeild a "The SYSTEM attribute group is read-only" error.

    Although you cannot change the end timecode of an asset, you can create a new subclip with CreateSubclip() call.

    Hope this helps,

    - Rob

     

    Imports VSBasicTest2.InterplayAssetsWS

    Public Class Form1

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

            Dim port As New AssetsPortTypeClient()

            Dim creds As New InterplayAssetsWS.UserCredentialsType()

            creds.Username = "a"

            creds.Password = "a"

            Dim param As New SetAttributesType()

            param.InterplayURIs = New String(0) {}

            param.InterplayURIs(0) = "interplay://WGC?mobid=060a2b340101010101010f0013-000000-000a11d8fc07fbf2-060e2b347f7f-2a80"

            param.Attributes = New AttributeType(0) {}

            param.Attributes(0) = New AttributeType()

            param.Attributes(0).Group = "SYSTEM"

            param.Attributes(0).Name = "END"

            param.Attributes(0).Value = "01:01:01:06"

            Try

                Dim response As SetAttributesResponseType = port.SetAttributes(creds, param)

                If Not IsNothing(response.Errors) Then

                    lblInfo.Text = response.Errors(0).Details.ToString()

                Else

                    lblInfo.Text = ""

                End If

            Catch ex As Exception

                lblInfo.Text = ex.Message.ToString

            End Try

        End Sub

    End Class

     

  • Fri, Sep 26 2014 9:28 AM In reply to

    • andym
    • Not Ranked
    • Joined on Thu, Jan 13 2011
    • Posts 109
    • Points 1,285
    • Avid Developer Moderator

    Re: Set attributes with web services

    Hi xudon,

    I cannot comment on the first question but no, you cannot set system attributes unless you change the underlying object, in this case the sub clip. That is the nature of a system attribute.

  • Fri, Sep 26 2014 2:15 PM In reply to

    • xudon
    • Not Ranked
    • Joined on Tue, Apr 15 2014
    • Posts 14
    • Points 180

    Re: Set attributes with web services

    Thank you very much to both for the fast response. Rob's answer pointed me to the right direction.

  • Wed, Jun 17 2015 7:32 PM In reply to

    • xudon
    • Not Ranked
    • Joined on Tue, Apr 15 2014
    • Posts 14
    • Points 180

    Re: Set attributes with web services

Page 1 of 1 (5 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller