Show / Hide Table of Contents

Getting Started with consuming Platina Standard API

Add the following to the consumer app.config file:

<system.serviceModel>
    <client>
      <endpoint 
        name="referenceDataManagement" 
        address="referenceDataManagement" 
        binding="netTcpBinding" 
        bindingConfiguration="SecureNetTcp" 
        contract="Integration.ServiceContracts.ReferenceDataManagement.IReferenceDataManagement" />
    
      <endpoint 
        name="caseManagement" 
        address="caseManagement" 
        binding="netTcpBinding" 
        bindingConfiguration="SecureNetTcp" 
        contract="Integration.ServiceContracts.CaseManagement.ICaseManagement" />
    
      <endpoint 
        name="deedManagement" 
        address="deedManagement" 
        binding="netTcpBinding" 
        bindingConfiguration="SecureNetTcp" 
        contract="Integration.ServiceContracts.DeedManagement.IDeedManagement" />
    
      <endpoint 
        name="documentManagement" 
        address="documentManagement" 
        binding="netTcpBinding" 
        bindingConfiguration="SecureNetTcp" 
        contract="Integration.ServiceContracts.DocumentManagement.IDocumentMangement" />
    
      <endpoint
        name="customObjectManagement"
        address="customObjectManagement"
        binding="netTcpBinding"
        bindingConfiguration="SecureNetTcp"
        contract="Integration.ServiceContracts.CustomObjectManagement.ICustomObjectManagement" />
    
      <endpoint
        name="meetingManagement"
        address="meetingManagement"
        binding="netTcpBinding"
        bindingConfiguration="SecureNetTcp"
        contract="Integration.ServiceContracts.MeetingManagement.IMeetingManagement" />
      
      <endpoint 
        address="mex" 
        binding="mexTcpBinding" 
        name="MeetingsPlusMex" 
        contract="IMetadataExchange" />
    </client>
    
    <bindings>
      <netTcpBinding>
        <binding name="SecureNetTcp" portSharingEnabled="true" transferMode="Streamed" receiveTimeout="00:05:00" sendTimeout="00:05:00" maxBufferSize="65536" maxReceivedMessageSize="2147483647">
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
</system.serviceModel>

This will make sure the consumer has the same binding and contract as the Platina Standard API server.

Import to your application the contract assembly:

  • It's available to download by reference 6.0.0.

  • Extract archive to root folder of your project.

  • In Visual Studio 2019 or later in Solution Explorer, right-click on the References node and choose either Add Reference

  • In the opened Reference Manager use Browse button to browse for a contract assembly and select its after that click Ok button.

  • After added, assembly will be available in the References.

Client application entry point

  • Navigate to the file Program.cs
  • Specify the endpoint in code, pass the address into constructor from app.config.
private EndpointAddress ReferenceEndpointAddress = new EndpointAddress($"net.tcp://{The name of the server}/GeneralWWW/PlatinaService.svc/referenceDataManagement");

Replace the {The name of the server} with the "hostname" of the Platina server.

Create a channel factory instance with credential:

using var channelFactory = new ChannelFactory<IReferenceDataManagement>("referenceDataManagement", ReferenceEndpointAddress);

//StandardServiceAuthorizedUser it is out primaryUser
channelFactory.Credentials.Windows.ClientCredential.UserName = "{StandardServiceAuthorizedUser}";
channelFactory.Credentials.Windows.ClientCredential.Password = "{password}";

Set the correct credentials on the channel factory. StandardServiceAuthorizedUser should be a windows user (local or domain), and configured in Platina "admin" settings (please refer to Installation )

Create a channel and call service contract method

var referenceDataManagement = channelFactory.CreateChannel();

var mappingData = referenceDataManagement.GetMappingData(new GetMappingDataRequest()
{
    UserName = secondaryUser,
    BusinessCodeTitlePattern = string.Empty,
    DiaryID = 1,
    ParagraphsSearchParams = string.Empty,
});
Back to top Created by Formpipe