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 10 Next »

In-progress

Introduction

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

Below are the steps to create your own end points in Aptify.


Step-by-Step Guide For Creating Controller

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

     

  2. In the above code ServiceRequestsContext object 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 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.

  3. After Building your Class Library you need to add genrated assembly into  Aptify.Services.FrameWork bin folder.

  4. 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  located  under web service of aptify.In Controller section there are four tabs available.

 General Tab: 

Name: Controller Name

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

 

Controller Genrated Classes Tab:

Once you saved the Controller record , the Controller Generated Classes fields will be automatically update.

Controller Routes Tab:

Controller routes  defines how URL looks like and how to access controller endpoint.You can add multiple controller routes. Field are  

Name:  Name of Controller Route

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

Route Help Text: It gives summary information about the controller and parameters expects from endpoint. These are standard .net /// comments. Once set these comments will displayed automatically in help page. 

 

 

Controller Routes Http Method Tab: 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 Tab: Defines how the controller can be accessed by defining path parts. It will correlate the URl access by user.

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 it's checked then URL expect the value defined above.if it's not checked then value is equal to variable value.

Is Optional: By default it's unchecked for the 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.

      4. Next step is to add record in Controller Configuration under web service in Aptify.

           Name: Controller Configuration Name

           Controller: Select Controller name that you have generated from list.

           Authorization Plugin: you can select autherization plugin if you need to provide autherization.

   Caching Policy:  Currently Aptify Supprots two types of cache policy. Nocaching for not to support cache policy and YearCaching whcih is along with timecache policy.You can set caching policy attribute      by passing number of year.

           Require Authentication: If checked it means it require valid authentication token for SOA. if not then controllers can be called without any credenticals.

           Allow Anonymous: If checked it allows anonymous user to access end point.

        5. Now you need to add record in Controller Configuration Collection under Controller Configuration Tab. Controller Configurations are grouped together in Controller Configuration Collections.

 

            If caching policy and authorization plugin is defined for controller configuration it will be override by policy defined in controller configurations.

       6. Now you need to set Service Application in web service for that controller collection. For this you add record of Controller Configuration Collections that you have created.

        

   

 

   

 

 

 

 

 

 


  • No labels