[This is preliminary documentation and is subject to change.]

The driver class drives all the web services calls. Each web service communicates with the outside world using simple data types. Complex data types are encoded in the xml format which is same as the serialized dataset. Instead of xml, the consumer can also use the dataset (in .net clients). Most services has a service type as argument. The service group determines which entity is addressed (example group, attachment, contact etc.). The service type is an enumerated type in OfficeClip, the integer value of which is used in the web service. Following are the service types that are currently implemented.
Service Item(Id)Description
Tracker Binder(1)The OfficeClip Tracker Binder.
Tracker Issue(4)The OfficeClip Tracker Issue.
Task(8)The OfficeClip Task. The Service subtype for this type is the Contact(18) and Account(31)
Member(11)The OfficeClip Member
Organization(13)The OfficeClip Organization
Event(14)The OfficeClip Calendar Events. The Service subtype for this type is the Contact(18) and Account(31)
Contact(18)The contact management metaentity
Note(20)The OfficeClip Notes Entity. The Service subtype for this type is the Contact(18) and Account(31)
Template Parent Child(23)The parent child values of the template. The service sub type for this type is the template type.
Attachment(24)Document attachments with various applications
Return Value(25)The return value format for various operations (e.g. Insert, Update)
Template Key Value(27)The Template key value information (used to merge a template)
Mail Merge Campaign(28)The mail merge campaign information
Mail Merge Campaign Recipients(29)The mail merge campaign recipient information
System Information(30)Provides Session and System Information
Account(31)Account Information
Project(32)Project information
Service Item(33)Services Item information
Timesheet(34)Timesheet information
Timesheet Detail(35)Timesheet Detail information. The service subtype for this type is Timesheet (34)
Expense(36)Expense information
Expense Detail(37)Expense Detail information. The service subtype for this type is Expense (36)
Expense Type(38)The Expense Type information. Expense type categories are: 1=air travel, 2=hotel, 3=auto rental, 4=taxi, 5=telephone, 6+ = other
Meta Information(39)Provides information regarding field name, field type, section name, list choices, default value, is required, is readonly and is visible for entities like contacts, accounts, opportunities etc.
Payroll Category(40)Provides various payroll categories like regular, exempt etc.
Some web services uses a string called the serial id (sid). The serial id is a globally unique string across all OfficeClip installation, application and data rows.

Namespace:OfficeClip.Service.Web
Assembly: �OfficeClip.Service (in OfficeClip.Service)
Version: 8.1.1.0

Syntax

C#
public class Driver
Visual Basic (Declaration)
Public Class Driver
Visual C++
public ref class Driver

Examples

CopyCreates a new connection to the Web Service
public static WebServiceClient.Generic.OfficeClipGeneric CreateConnection()
{
 // create an instance of the web service client
 WebServiceClient.Generic.OfficeClipGeneric ofg = 
    new WebServiceClient.Generic.OfficeClipGeneric();
 // Create a cookie container so that the session can persist on the server
 ofg.CookieContainer = new System.Net.CookieContainer();
 return ofg;
}
CopyLogin to the Web Service
public static void Login(
 WebServiceClient.Generic.OfficeClipGeneric ofg, string emailAddress, string password
 )
{
 try
 {
    // try using the webservice to validate the user, if successful,
    // an user session will be created
     string msg = ofg.ValidateUser(emailAddress, password);
    if (msg == string.Empty)
     Console.WriteLine("Login Successful");
    else
     Console.WriteLine("Login Failed: " + msg);
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
}
CopyGet the Organization data
public static DataSet GetOrganizationData(
 WebServiceClient.Generic.OfficeClipGeneric ofg
 )
{
 DataSet ds = null;
 try
 {
    // Service Type 13 is for organization data
    ds = ofg.GetDataSet(13, -1, string.Empty, string.Empty, string.Empty, -1);
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
 return ds;
}
CopyGets the template parent child for contacts
public static DataSet GetTemplateParentChild(
 WebServiceClient.Generic.OfficeClipGeneric ofg
 )
{
 DataSet ds = null;
 try
 {
    // Service Type 23 is for parent child template
    // Service sub type of 15 is for template type contact
    ds = ofg.GetDataSet(23, 15, string.Empty, string.Empty, string.Empty, -1);
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
 return ds;
}
CopyGets numbered rows from all the contacts
public static DataSet GetAllContacts(
 WebServiceClient.Generic.OfficeClipGeneric ofg, string filter
 )
{
 DataSet ds = null;
 try
 {
  // Service Type 18 is for Contact
  // it also returns the columns firstName, lastName and title
     ds = ofg.GetDataSet(18, -1, "", filter, string.Empty, -1);
    // ds = ofg.GetDataSet(18, -1, "firstName,lastName,title", string.Empty, string.Empty, -1);
 }
 catch (SoapException ex)
 {
  Console.WriteLine(ex.Message);
 }
 return ds;
}
CopyInserts a campaign attachment
/// <summary>
///  Inserts a campaign. The campaign is previously saved as c:\temp\test.doc
///  This will insert the campaign document in OfficeClip via the web service.
/// A mailmerge campaign will be stored in OfficeClip as attachemtn
/// </summary>
/// <param name="ofg">Reference to the web service proxy</param>
public static void InsertCampaignAttachment(
 WebServiceClient.Generic.OfficeClipGeneric ofg,
 string sid
 )
{
 DataSet ds = null;
 try
 {
    // Retrieve the schema for service type 24 (attachments)
    StringReader sr = new StringReader(ofg.GetXmlSchema(24));
    ds = new DataSet();
    ds.ReadXmlSchema(sr);
    sr.Close();
    // This schema will be used to create a dataset to insert value
    // in OfficeClip.
    ds.Tables.Add(new DataTable());
    DataTable dt = ds.Tables[0];
    DataRow dr = dt.NewRow();
    dr["sid"] = "1";
    dr["fileName"] = "test.doc";
    dr["documentKey"] = "";
    dr["documentDescription"] = "";
    dr["applicationId"] = 27; // The application id 27 is the application id of the campaign
    dr["applicationSecondaryId"] = 1; // secondary id of 1 denotes attachment for mailmerge campaigns
    dr["id"] = sid;
    dr["isZipped"] = false; 
    // Open the campaign from the local drive for reading
    FileStream fs = new FileStream(
     @"c:\temp\test.doc",
     FileMode.Open,
     FileAccess.Read
    );
    // Read the file as a set of bytes so it can be serialized by the webservices interface
    // and sent. The webservice will reconstruct the file at the server.
    BinaryReader br = new BinaryReader(fs);
    dr["bytes"] = br.ReadBytes((int)br.BaseStream.Length);
    dt.Rows.Add(dr);
    // Send the file as attachment
    DataSet dsResult = ofg.Insert(24, ds);
    // The schema of the returning dataset can be extracted using the GetSchema call
    // with service type 25 (Return value). For this example we know that there are
    // two columns called sid (unique service id) and errorDescription.
    Console.WriteLine("Serial Id: " + (string)dsResult.Tables[0].Rows[0]["sid"]);
    Console.WriteLine("Error: " + (string)dsResult.Tables[0].Rows[0]["errorDescription"]);
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
}
CopyDeletes a campaign attachment
public static DataSet DeleteCampaignAttachment(
 WebServiceClient.Generic.OfficeClipGeneric ofg,
 string sid
 )
{
 DataSet ds = null;
 try
 {
    // Service Type 24 is for campaign data
    bool status = ofg.Delete(24, sid);
    Console.WriteLine((status) ? "Delete Successful" : "Delete Failed");
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
 return ds;
}
CopyTest if the session exists
public static void IsSessionExists(
 WebServiceClient.Generic.OfficeClipGeneric ofg
 )
{
 try
 {
    bool exists = ofg.IsSessionExists();
    Console.WriteLine((exists) ? "Session Found" : "Session could not be found");
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
}
CopyEnd the session to the Web Service
public static void EndConnection(
 WebServiceClient.Generic.OfficeClipGeneric ofg
 )
{
 try
 {
    ofg.SessionOver();
 }
 catch (SoapException ex)
 {
    Console.WriteLine(ex.Message);
 }
}

Inheritance Hierarchy

System..::.Object
��OfficeClip.Service.Web..::.Driver

See Also