Quick Start (MTOM): Move Content Services content using the web service API (Deprecated)

The following C# code example moves a PDF file named MortgageForm.pdf from /Company Home/Test Directory to /Company Home. The identification value of the moved content is written to the console. (See Creating Content Services (deprecated) Spaces.)

???/** 
    * Ensure that you create a .NET project that uses  
    * MS Visual Studio 2008 and version 3.5 of the .NET 
    * framework. This is required to invoke a  
    * LiveCycle service using MTOM. 
    *  
    * For information, see "Invoking LiveCycle using MTOM" in Programming with LiveCycle.   
    */ 
 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.ServiceModel; 
using System.IO; 
using MoveContent.ServiceReference1; 
 
namespace MoveContent 
{ 
       class Program 
       { 
           static void Main(string[] args) 
           { 
               try 
               { 
                   //Create a DocumentManagementServiceClient object 
                   DocumentManagementServiceClient docManagement = new DocumentManagementServiceClient(); 
                   docManagement.Endpoint.Address = new System.ServiceModel.EndpointAddress("http://localhost:8080/soap/services/DocumentManagementService"); 
 
                   //Enable BASIC HTTP authentication 
                   BasicHttpBinding b = (BasicHttpBinding)docManagement.Endpoint.Binding; 
                   b.MessageEncoding = WSMessageEncoding.Mtom; 
                   docManagement.ClientCredentials.UserName.UserName = "administrator"; 
                   docManagement.ClientCredentials.UserName.Password = "password"; 
                   b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; 
                   b.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; 
 
                   //Specify the name of the store and the content to move 
                   String storeName = "SpacesStore"; 
                   String nodeName = "/Company Home/Test Directory/MortgageForm.pdf"; 
                   String newSpace = "/Company Home"; 
 
                   //Move the content from /Company Home/Test Directory 
                   //to /Company Home 
                   String contentID = docManagement.moveContent(storeName, nodeName, newSpace); 
                   Console.WriteLine("The identifier value of the moved content is " + contentID); 
               } 
               catch (Exception ee) 
               { 
                   Console.WriteLine(ee.Message); 
               } 
 
           } 
       } 
}