Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Introduction

Aptify has developed a new funtionality to new functionality to drop a new custom end points that will be addressed by URI through SOA. It will allow customers to build  there develop there own end point as per there requirement.

In Order Below are the steps to create your own end point you need to build a new end point logic as a separate project and define end points for metadata in service application under web servicesin Aptify.


Step-by-Step Guide For Creating Controller

  1. Create a new project Class Library to add a controller belowand save  in Aptify code base like "../Main/Aptify.Services/Framework/Endpoints/Implementations". you need to add Aptify.servicesFramework dll as reference in your projectclass library. Here Below is sample project created to demonstrate simple variable display functionalitycode  to demonstrate on how to pass parameter and display parameter value.

    Code Block
    languagec#
    linenumberstrue
    using System;
    using Aptify.Services.Framework.Endpoints;
    namespace ParamDemo
    
    {
        public class TestController : Aptify.Services.Framework.Endpoints.ServiceController
        {
            public override Aptify.Services.Framework.Endpoints.ServiceResponse ProcessRequest(Aptify.Services.Framework.Endpoints.ServiceRequestContext context)
            {
                string param1 = (string)context.ServiceParameters["param1"];    //to pass parameter1 to service request
                ServiceResponse response = new ServiceResponse();
                response.Content = new StringContent("Parameter1 having value:" + param1); // response display to client
                return response;
            }
        }
    }

    In the above code ServiceRequestsContext object  having is having information about request i.e.  ControllerName, cookies,Headers, httpmethod,query parameter,AuthenticatedContext, service parameter. Service parameters are non literal values that are defined in route. . miscProperties are used in Autherization plugin . to put the results of parsing into dictonary dictionary and provide result to service request. 
    ServiceResponse  object provide information about response content. After building above class library you need to copy the assembly and add the reference in object repository in Aptify.

     

  2. In Aptify you should put the controller into Object Repository  under services packages.

...

 3. Next step is to add controller definition. Create a new record in Controller by giving name and  adding reference of dot net class Plugin which is  located  under web service of aptify. Provide Name and  dotnet class Plugin   as shown below.

Name: Controller Name

dotnet Class Plugin:  is class responsible for servicing actual request and getting data.

Controller Genrated classes will be automatically genrated when you save controller record. It is genrally for aptify Internal use

...