Latest post Wed, Feb 17 2016 8:21 PM by handtruck. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • Fri, Feb 12 2016 3:47 PM

    • handtruck
    • Not Ranked
    • Joined on Mon, Apr 21 2014
    • Posts 56
    • Points 605

    Getting an AAF from Interplay

    Is this only possible with AMT, or is there some way to do it with Interplay Web Services?

     

  • Fri, Feb 12 2016 4:01 PM In reply to

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

    Re: Getting an AAF from Interplay

    handtruck,

    For an asset that is checked in, just use GetLatest() - or are you looking for something different?

    Andy

  • Fri, Feb 12 2016 4:21 PM In reply to

    • handtruck
    • Not Ranked
    • Joined on Mon, Apr 21 2014
    • Posts 56
    • Points 605

    Re: Getting an AAF from Interplay

    That will do it!  Apparently, I zoomed right past this when looking at the documentation.

    When using this using C# for example, how does one actually retrieve the file.  Is there any example code?

  • Mon, Feb 15 2016 2:23 PM In reply to

    • omsupport
    • Not Ranked
    • Joined on Tue, Aug 20 2013
    • Posts 83
    • Points 900

    Re: Getting an AAF from Interplay

    Dunno about C#, but in Java I use javax.activation.DataHandler, as follows:

    GetLatestResponseType rsptype = ... // response from GetLatest

    DataHandler dh = rsptype.getFile();

    FileOutputStream out = new FileOutputStream(file);

    dh.writeTo(out);

    out.flush();

    out.close();

     

  • Wed, Feb 17 2016 3:43 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: Getting an AAF from Interplay

    Greetings,

    Here's a code snippet to call GetLatest() in C# and write out the file:

    GetLatestResponseType response = port.GetLatest(credentials, request);
    File.WriteAllBytes("c:\\folder\\latest.aaf", response.File)

    Note that the maxReceivedMessageSize size will need to be increased for AAF files. This can be done by adding a parameter to the binding setting in App.config:
      <binding name="Assets_AssetsPort" messageEncoding="Mtom" maxReceivedMessageSize = "1000000"/>

    The full source code is here:
      http://pastebin.com/bGb4MNph

    - Rob

     

  • Wed, Feb 17 2016 8:21 PM In reply to

    • handtruck
    • Not Ranked
    • Joined on Mon, Apr 21 2014
    • Posts 56
    • Points 605

    Re: Getting an AAF from Interplay

    Thanks, Rob.  Actually figured this out and was about to post as well.

    Regarding the binding, I thought I'd share how I do it - this allows you to set the web services machine and the binding stats at runtime (some of it is hard coded, but you can see there are options to change if you want).  You call the aptc.[name of function] and you're good to go.  This example is for Assets, but you can use it for the others as well.

     

                EndpointAddress endAdd = new EndpointAddress(wsaddress + "/services/Assets");

                AssetsPortTypeClient aptc = new AssetsPortTypeClient(getBinding(), endAdd);

     

            TimeSpan timeout = new TimeSpan(0, 10, 0);

            long buffer = 20000000;

            public BasicHttpBinding getBinding()

            {

                BasicHttpBinding bindy = new BasicHttpBinding();

                bindy.SendTimeout = timeout;

                bindy.ReceiveTimeout = timeout;

                bindy.MaxBufferPoolSize = buffer;

                bindy.MaxBufferSize = Convert.ToInt32(buffer);

                bindy.MaxReceivedMessageSize = buffer;

                bindy.MessageEncoding = WSMessageEncoding.Mtom;

                bindy.BypassProxyOnLocal = true;

                bindy.UseDefaultWebProxy = false;

                return bindy;

            }

     

     

Page 1 of 1 (6 items)

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