Is this only possible with AMT, or is there some way to do it with Interplay Web Services?
handtruck,
For an asset that is checked in, just use GetLatest() - or are you looking for something different?
Andy
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?
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();
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
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;
}
© Copyright 2011 Avid Technology, Inc. Terms of Use | Privacy Policy | Site Map | Find a Reseller