Show/Hide Toolbars

Therefore Web API Programming Interface 1.0

Retrieval is the process of reading documents and their index data information from the server. Given a document's unique number, the Step-by-Step guide shows how to retrieve a document from the Web API service.

 

You can retrieve index data, file streams (including binary data of streams), and the checkout status of the document. Please see parameter details in the GetDocument section.

 

 

 

 // 1. Create a channel factory to the web service endpoint

 ...

 ChannelFactory<IThereforeServicechannelFactory = new ChannelFactory<IThereforeService>(bindingendpoint);

 

 // 2. Create a channel for the web service endpoint

 IThereforeService service = channelFactory.CreateChannel();

 

 // 3. Create requested parameters

 GetDocumentParams parameters = new GetDocumentParams();

 parameters.DocNo = docNo;

 parameters.IsStreamsInfoNeeded = true;

 parameters.IsIndexDataValuesNeeded = true;

 

 // 4. Retrieve the document from the server.

 GetDocumentResponse response = service.GetDocument(parameters);

 

 // 5. Close the channel and channel factory.

 ((IClientChannel)service).Close();

 channelFactory.Close();

 

 // 6. Process response.

 string docInfo = String.Format("Successfully retrieved {0}Document No: {1}"Environment.NewLineresponse.DocNo);

 

 foreach (var streamInfo in response.StreamsInfo)

         docInfo += String.Format("{0}Stream No: {1}, File name: {2}"Environment.NewLinestreamInfo.StreamNostreamInfo.FileName);

 

 foreach (var indexDataItem in response.IndexData.IndexDataItems)

         docInfo += String.Format("{0}Index data field no: {1}, value: {2}"Environment.NewLineindexDataItem.Value.FieldNoindexDataItem.Value.ObjDataValue);

 

 MessageBox.Show(docInfo);

 

 

 

© 2023 Therefore Corporation, all rights reserved.