Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SelfURL
my api call is this:
http://localhost/api/funeral/16326P
what is returned as self is:
"self": {
"href": "http://localhost/api/funeral"
in http_resource_services - SelfURL = http://localhost/api/funeral
I want it to be:
"self": {
"href": "http://localhost/api/funeral/16326P"
it used to be there before I did the upgrade mods, so I must have made a mistake somewhere and I dont know where to look.
Can you help me at all.
http://localhost/api/funeral/16326P
what is returned as self is:
"self": {
"href": "http://localhost/api/funeral"
in http_resource_services - SelfURL = http://localhost/api/funeral
I want it to be:
"self": {
"href": "http://localhost/api/funeral/16326P"
it used to be there before I did the upgrade mods, so I must have made a mistake somewhere and I dont know where to look.
Can you help me at all.
Comments
Appears to me - It is the http_service_setup code that is creating the selfurl with this (wrong)data.
// The Full End Point URL indicates the URL submitted by the client.
FullEndPointURL = HTTP_Services('GetFullEndPointURL')
// The HTTP method (or verb) submitted by the client.
HTTPMethod = HTTP_Services('GetHTTPRequestMethod')
// The Self URL represents the Full End Point URL up to the current segment. This often used to in hypermedia responses
// so clients know how to trace back.
LenRemainingURL = Len(RemainingURL)
LenFullEndPointURL = Len(FullEndPointURL)
where fullendpointurl=http://localhost/api/funeral/16326P
SelfURL = FullEndPointURL[1, (LenFullEndPointURL - LenRemainingURL)]
If SelfURL[-1, 1] = '/' then SelfURL[-1, 1] = ''
HTTP_Services('SetSelfURL', SelfURL)
where selfURL is now http://localhost/api/funeral/
Any idea where the clearing of RemainingURL should be occuring
Now I am getting this response and I really dont know what I have done to cause it.
Any ideas?
{
"URL": "http://localhost/api/funeral/16326P",
"method": "GET",
"phrase": "Unauthorized (RFC 7235)",
"status": 401
}
i missed changing this line from oecgi4 to oecgi3 (oecgi3 is actually a renamed oecgi4, but the docs still refer to 3 so I was confused enough as it was :) )
OECGIRegKey = 'HKLM\SOFTWARE\Wow6432Node\Revsoft\OECGI4' ; // 64-bit server with OECGI4.exe
this is what I had in my _service routines(from rev version).
HAL = HTTP_Resource_Services('GetDatabaseItem', 'STOCK', SelfURL, ItemID,ColumnNames)
I changed to this:
//bjs//
ItemURL = SelfURL : '/' : ItemID
HAL = HTTP_Resource_Services('GetDatabaseItem', 'STOCK', ItemURL, ItemID,ColumnNames)
*HAL = HTTP_Resource_Services('GetDatabaseItem', 'STOCK', SelfURL, ItemID,ColumnNames)
Your http_contact_services now has this
HAL = HTTP_Resource_Services('GetDatabaseItem', 'CONTACTS', SelfURL : '/' : ItemID, ItemID)
I obviously missed the advise to change to this calling assembly.
Now you have me confused. Where in the docs does it still refer to 3?
When was the last time you upgraded your system? The format was introduced in v2.0.0, which is almost a year old. I didn't think to consider that your end point web service may have had older formatting because I just assumed you had been upgrading in stages.
But, for what it is worth, we did not spell out every code change between v1 and v2. Every routine that had been changed was listed in the version history page and we did post an article specifically to address some of the major differences between v1. and v2, but we could not reasonably explain every possible impact (nor did we intend to). We do endeavor to note which entities have been modified and we do try to note the major changes within the comment block of each routine. Beyond that, we leave it to the developer to decide if the new features are worth the effort to retrofit the new code into the older web app. I wish there was a better solution but one has not presented itself.
Sorry, the RTI oecgi setup docs.