Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Version 2.0.1 Released

SRP HTTP Framework v2.0.1 is officially released. Version 2.0.0 had been released but it was not announced since there is work already being done with v2.0.1.

Please see the Version History page for specific details of the changes. There is also a Core Changes Between v1.0.0 and v2.0.0 article to help customers with older versions of the product to better prepare for the transition.

With this release of the product is a wholly revamped set of documentation on our wiki page. Much of the original content is there, but everything has been re-organized to help developers who are new to this tool to get off the ground much quicker. Please take a look at the Creating a Web Service section. It covers a lot of the basics that previously had to be verbally explained or discovered through a bit of exploration through the code.

There is a lot of new content, including pages for every stored procedure and service that comes with the SRP HTTP Framework product. We think you will like what you find.

Comments

  • Thank You
  • Don,

    Not sure if I have missed this, but should not there be a mention somewhere that the services that are created need to be added in the code for HTTP_Entry_Point_Services.
  • When you started to mention the SRP framework setup, I was expecting to see a @vm list in there where you enter the names of the services to avoid having to remember which ssp to change and to change in 2 areas. :)
  • ..sorry, 3 areas
  • obviously nothing better to do with my time

    .
    .
    .
    MyServices=xlate("SYSENV","SRP_HTTP_FRAMEWORK_SETUP",7,"X") locate NextSegment in MyServices setting NextSegmentPos else NextSegmentPos=False$ end Begin Case Case RemainingURL _EQC '' // There is no remaining URL, which means this is the end point. SelfURL = HTTP_Services('GetSelfURL') Begin Case Case HTTPMethod _EQC 'GET' ; GoSub Get Case HTTPMethod _EQC 'OPTIONS' ; GoSub Options Case Otherwise$ ; ValidMethod = False$ End Case Case NextSegmentPos // NextSegment contains the name of another service. The RemainingURL must be updated to show that the // NextSegment is not longer a part of the RemainingURL. Then the RunHTTPService service should be called. RemainingURL = Field(RemainingURL, '/', 2, 99) HTTP_Services('RunHTTPService', NextSegment, RemainingURL) Case Otherwise$ HTTP_Services('SetResponseStatus', 404, NextSegment : ' is not a valid service request within the ' : CurrentServiceHandler : ' module.') End Case If Not(ValidMethod) then HTTP_Services('SetResponseStatus', 405, HTTPMethod : ' is not valid for this service.') HTTP_Services('SetResponseHeaderField', 'Allow', 'GET', True$) HTTP_Services('SetResponseHeaderField', 'Allow', 'OPTIONS', True$) end If Assigned(Response) else Response = '' Return Response //---------------------------------------------------------------------------------------------------------------------- // Get // // @@DEFINE_SERVICE(Get) // // Returns the available services. //---------------------------------------------------------------------------------------------------------------------- Get: Services = '' HREFNames = MyServices convert @vm to @fm in HREFNames HREFURIs = '' loop while HREFNames HREFName=HREFNames[1,@fm] HREFNames[1,col2()]=null$ HREFURIs := SelfURL : '/':HREFName : @FM repeat HREFURIs[-1,1]=null$ HTTP_JSON_Services('SetHALCollection', SelfURL, HREFURIs, HREFNames) If Error_Services('NoError') then Services = HTTP_JSON_Services('GetHAL') HTTP_Services('SetResponseBody', Services, False$, 'application/hal+json') end else HTTP_Services('SetResponseStatus', 500, '') end Response = Services return
    .
    .
    .
  • Barry,
    Not sure if I have missed this, but should not there be a mention somewhere that the services that are created need to be added in the code for HTTP_Entry_Point_Services.
    The relevant article for this is covered under Pass Throughs and End Points.

    You only mentioned HTTP_Entry_Point_Services, but this is necessary for any web service routine that is designed to pass the handling onto another service.
    When you started to mention the SRP framework setup, I was expecting to see a @vm list in there where you enter the names of the services to avoid having to remember which ssp to change and to change in 2 areas. :) ..sorry, 3 areas
    You can optimize the code as you have done, but that is not a case that will work for everyone. Also, designing it that way (IMO) abstracts the design too much. That is, it makes it that much harder to see what the service is supposed to do. When I look at your code, it is impossible to see what services are supported. If you are okay with that, then great, program it in the way that best suits your needs. That's part of the reason we give you all of the source code: you might prefer to do things a bit differently.
  • Thank you, duly noted.
  • Barry,

    I should say that I am pleased to see that are using the SRP_HTTP_FRAMEWORK_SETUP record. I had intended (but forgot) to publish that we will probably reserve a few attributes for your use. That way you can feel confident that we won't steal them at a later date.

    I would recommend, however, that you create your own service in HTTP_Services to pull this data for you rather than doing a direct Xlate. The whole point of being service oriented is to avoid direct database calls like this so the whole system can be self-documenting and if you ever decide to change the location of your services, you just need to update the service code rather than going through and updating all of those Xlates.
Sign In or Register to comment.