Advertisement
robgonsalves

IPWS C# GetLatest

Feb 17th, 2016
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.95 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using GetLatestExample.InterplayWS;
  4.  
  5. // Example code for the GetLatest() call into Interplay Production Web Services
  6. //
  7. // The service reference to the IPWS endpoint needs to be added:
  8. // 1. Right-click on the project name in the Solution Explorer
  9. // 2. Choose Add Service Reference
  10. // 3. Type in the URL to the IPWS Assets WSDL, example: <http://<server>/services/Assets?wsdl
  11. // 4. Add the namespace InterplayWS
  12. // 5. Click OK
  13. //
  14. // Note that the maxReceivedMessageSize size will need to be increased for AAF files.
  15. //
  16. // This can be done by adding a parameter to the binding setting in App.config:
  17. //    <binding name="Assets_AssetsPort" messageEncoding="Mtom" maxReceivedMessageSize = "1000000"/>
  18. //
  19.  
  20. namespace GetLatestExample
  21. {
  22.     class Program
  23.     {
  24.         static void Main(string[] args)
  25.         {
  26.             // create the port object
  27.             AssetsPortTypeClient port = new AssetsPortTypeClient();
  28.  
  29.             // setup the credentials
  30.             UserCredentialsType credentials = new UserCredentialsType();
  31.             credentials.Username = "username";
  32.             credentials.Password = "password";
  33.  
  34.             // create the request object
  35.             GetLatestType request = new GetLatestType();
  36.  
  37.             // specify the folder
  38.             request.InterplayURI = "interplay://WGC?mobid=060a2b340101010101010f0013-000000-545fc90cdb4e0002-060e2b347f7f-2a80";
  39.  
  40.             // get the latest
  41.             GetLatestResponseType response = port.GetLatest(credentials, request);
  42.  
  43.             // print out the response
  44.             if (response.Errors != null && response.Errors.Length > 0)
  45.                 Console.WriteLine("error: " + response.Errors[0].Message +
  46.                 ", " + response.Errors[0].Details);
  47.             else
  48.             {
  49.                 File.WriteAllBytes("c:\\folder\\latest.aaf", response.File);
  50.                 Console.WriteLine("Success");
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement