04. Hydra C# Plugin Module
Channel: Ondrej Kelle
Date: 2016-08-19

Using RemObjects Hydra to consume a .NET WCF service from Delphi

- Create a new Hydra Plugin Library project:
  - Right-click solution, Add\New\Project...
  - Installed\Visual C#\Hydra\Plugin Module
- Create a new Hydra Plugin:
  - Right-click project, Add\New Item...
  - Installed\Visual C# Items\Non-Visual Plugin
- Add System.ServiceModel reference
- Add service client library reference
- Create a COM-compatible interface
  - Right-click project, Add\New Item...
  - Installed\Visual C# Items\Code\Interface
  - Declare interface IService1Client (public)
  - Inherit from IHYCrossPlatformInterface (RemObjects.Hydra.CrossPlatform)
  - Add IID
  - Add methods
  - Add CompositeType struct
    - Add StructLayout attribute
    - Add MarshalAs attributes
  - Declare data contract parameter ref on the C# side, const on Delphi side
- Make the plugin implement the interface by delegating to the WCF service client library