If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

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

In Order to create 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 services.


Step-by-Step Guide For Creating Controller

  1. Create a new project to add a controller below../Main/Aptify.Services/Framework/Endpoints/Implementations. you need to add Aptify.servicesFramework dll as reference in your project.Here is sample project created to demonstrate simple variable display functionality.

    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;
            }
        }
    }

    ServiceRequestsContext object  having information 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 and provide to service request. 
    ServiceResponse  object provide information about response content.

  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 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

Controller route  defines how URL looks like how to acess controller endpoint is defined here.You can add multiple controller routes.

Name:  Name of Controller route

Route Regular Expression:  Route Regular expression are genrated by entity plugin for controller route.You need not to set it manually.It is used internally in SOA.

Route Help Text: It gives summary information about the controller and parameters thats it expects. These are standard .net /// comments. after setting these comments  it will automatically displayed in help page. 

Controller Route Http Method: You can select any standard http method defined in list.There are seven types of standard http method available in aptify. DELETE,GET,HEAD, OPTIONS,POST,PUT and TRACE..

Controller Route Path Parts:defines how the controller can be accessed by defining path parts. It will correlate the URl  how  user will access URL.

Type: it will be any data type string, int, boolean etc.

Value: It may be part value or variable value. for example in above ParamDemo is part value which will be actual displayed in URI. but param1 is variable value which will be replaced by string variable in URl.

Is Literal:  if checked then URL expect the value defined above.if not checked then value will be variable value.

Is Optional:  if checked for part  then value will be optional in the URI. But Is Optional checking should be logical. URI will be invalid if we checked Is Optional option for value but deselect for variable value.

 

 


  • No labels