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

The following C# code example lists content that is located in /Company Home. Each node type and node name is displayed. (See Listing Content Services (deprecated) Content.)

???/** 
    * 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 ListContent.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"; 
                   bool ans = false;  
 
                   //List the contents of /Company Home 
                   ListContent.ServiceReference1.MyArrayOfCRCResult allList = docManagement.getSpaceContents(storeName, nodeName, ans); 
 
                   //Iterate through the list and get tne type and name 
                   //of each element 
                   int count = allList.Count; 
 
                   for (int y = 0; y < count; count++) 
                   { 
                       CRCResult sinContent = (CRCResult)allList[y]; 
                       String nodeType =  sinContent.nodeType; 
                     String name = sinContent.nodeName; 
                     Console.WriteLine("The node type is "+nodeType  +". The node name is "+name);  
 
                   } 
               } 
               catch (Exception ee) 
               { 
                   Console.WriteLine("An unexpected exception was encountered: " + ee.Message + "\n" + ee.StackTrace); 
               } 
 
           } 
       } 
} 
 

// Ethnio survey code removed