Please or Register to create posts and topics.

Web Service Example: Get the Organization Data

Here is an example of how to use the OfficeClip Web Service Client to get the organization information

Code:


using System;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;
using WebServiceClient.Generic;

namespace WebServiceClient
{
public class Program
{
  static void Main(string[] args)
  {
   // Create a web services connection
   WebServiceClient.Generic.OfficeClipGeneric ofg = new WebServiceClient.Generic.OfficeClipGeneric();

   try
   {
    // Create a cookie container so that the session can persist on the server
    ofg.CookieContainer = new System.Net.CookieContainer();
   
    // Login to the Server
    string errorMessage = ", "password");
    Console.WriteLine ( (errorMessage == string.Empty) ? "Login Successful" : "Login Failed: " + errorMessage);

    DataSet ds = null;
     // Service Type 13 is for organization data
    DataSet ds = ofg.GetDataSet(13, -1, string.Empty, string.Empty, string.Empty, -1);
   }

   catch (SoapException ex)
   {
    Console.WriteLine(ex.Message);
   }

   finally
   {
     // Finally end the Session with OfficeClip Server
    ofg.SessionOver();
   }
 }
}

To interpret the DataSet of the above code we need to use the Schema for the organization data, for that we can use the following code fragment:

Code:


  string XmlSchema = ofg.GetXmlSchema(13);

where 13 is the service item code. Various service items codes are given in the document: https://www.officeclip.com/docs/output/webservice/index.html