C# BDK Clients


Note:

The samples featured on this page work only for Oracle Beehive Release 2 (2.0.1.0)


The following topics are covered:

Setup with Standard APIs

The following steps describe how to generate the Oracle Beehive RESTful Web services value objects using Microsoft XML Schema Definition Tool, Xsd.exe:

  1. Obtain Xsd.exe from .NET Framework SDK. Refer to "Microsoft Developer Network, MSDN" for more information.

  2. Download the following XSD files:

    • <Host name and port of your Oracle Beehive HTTP server> /comb/v1/schema-obh.xsd

    • <Host name and port of your Oracle Beehive HTTP server> /comb/v1/schema-obr.xsd

  3. Generate a .cs source code file from the file schema-obh.xsd:

    xsd schema-obh.xsd /classes
    
  4. Generate a .cs source code file from the file schema-obr.xsd:

    xsd schema-obr.xsd /classes
    
  5. Edit the generated source code file, schema-obr.cs. Search for the class definition public partial class list. Before this class definition, add the highlighted line as follows:

                                           
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.oracle.com/beehive", IsNullable = false)]
    public partial class list
    {
      private object[] elementsField;
                                        

C# BDK Examples

This section covers the following topics:

CSExampleCon C# Sample

The file Program.cs contains the main logic of the sample. It performs the following tasks:

  • Authentication

    • Retrieves the logged in user's information

    • Retrieves the logged in user's personal workspace information

  • Listing artifact identifiers

    • Retrieves the folders of type HeterogeneousFolder of the logged in user

  • Using projections

    • Retrieves the logged in user's information with an EMPTY projection, then with a BASIC projection.

  • Creating simple objects

    • Creates a team workspace

  • Creating objects with simple content

    • Creates a Document artifact that contains a text document

  • Creating artifacts with uploaded content

    • Creates a Document artifact that contains a text document, then creates a Topic with a reference to the Document

CSExampleCon C# Files

The CSExampleCon C# sample, csharp_bdk_sample.zip , consists of the following files:

  • Properties\AssemblyInfo.cs

  • CSExampleCon.csproj

  • Method.cs

  • Program.cs

  • schema-obh.cs and schema-obr.cs: Refer to "Setup with Standard APIs" to generate these files.

  • Session.cs

  • Tests.cs