Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Anand Raj
    Regarding Release 17.2.1 (V4.0) — April 2017
    Topic posted April 10, 2017 by Anand RajRed Ribbon: 250+ Points, last edited April 25, 2017 
    32 Views, 16 Comments
    Title:
    Regarding Release 17.2.1 (V4.0) — April 2017
    Summary:
    Regarding Release 17.2.1 (V4.0) — April 2017
    Content:

    Hi All ,

    I am facing an issue with Custom Api after the "Release 17.2.1 (V4.0) — April 2017"  .

    Issue Faced

    -----------------

    I am having a third party server , say http://<IP : port>/hrmsservices/<worklist/absenceCompetencyAction> . Created connector api using the IP address .  I am getting responses from the connector api . Then i created custom api . 

    When i added a number of endpoints in the same connector api and uploaded the zip file to MCS , I am getting success response from the custom api also for those endoints that i have added at the time of Custom API creation .

    Issue comes when i and another or a number of endpoints to the same custom API . The error that i am getting is

    {

           "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",

            "status": 404,

           "title": "API not found",

           "detail": "We cannot find the API *****/1.0 for the provided URL path /myprofile/employment. Verify your request parameters and try again.",

           "o:ecid": "005JCyrxvLGA9T3_Rll3id0004M900002n, 0:3",

           "o:errorCode": "MOBILE-57945",

           "o:errorPath": "/mobile/custom/*****/myprofile/employment"

    }

    ( I have added the endpoints  the custom api for the newly added APIs)

    I have noticed some new files in the " Javascripts scaffold " like " swagger.json , " , " toolsConfig.json " and " *****.raml ". 

    toolsConfig.json , swagger.json contains details about the endpoints that added for the first time during the api creation and the details of the endpoints that added later is not present .


    Could anyone please tell me how to solve this issue ? Is there any documents available for the changes after  the Release 17.2.1 (V4.0) — April 2017 .

    Thanks in Advance

    Comment

    • Tom Ware

      It is not clear to me exactly what issue you are seeing.

      Are you saying that you have an API that worked prior to the upgrade and some part of it stopped working after the upgrade or are you saying that you had an api that worked before the upgrade and the changes you have made after the upgrade are not working for you?

      I have tried the following on my local instance with success.  Please tell me what is different

      1. Start with a working API

      2. Navigate to endpoints and add a new resource

      3. Add the GET method to the resource

      4. Save

      5. Generate the scaffold

      6. Examine the scaffold and see the new resource in all the relevant files

      7. Upload the scaffold as my implementation

      8. Test the new GET resource

    • Anand Raj

      Thanks for your reply .
      Sorry to hear that my question is not clear to you .

      Your Question

      ------------------

      Are you saying that you have an API that worked prior to the upgrade and some part of it stopped working after the upgrade --- No

      or are you saying that you had an api that worked before the upgrade and the changes you have made after the upgrade are not working for you?--Yes (endpoints that i added yesterday means after the upgrade is not working)

      From my side

      ------------------

      1. Start with a working API -- Success
      2. Navigate to endpoints and add a new resource-- Success
      3. . Add the http method to the resource-- Success
      4. save and download the zip file-- Success
      5. uploaded the zip file after writing the api logic-- Success
      6. then i added some other endpoints -- Success
      7. uploaded the zipfile that downloaded previously with the logic for the newly added endpoints-- Success
      8. When i test the newly added api i am getting 404 Api not found error .

      My doubt is "whether i have to download the zip file from the custom api implemetation after each time when an endpoint is added ?" . Currently what i did is modified the previously downloaded zip file and uploaded to MCS

      NB:

      I have tried to download the scaffold rather than modify the alredy downloaded zip file each time when a new endpoint is added.

    • Tom Ware

      The scaffold is intended as a starting point.

      When you generate a scaffold, it will generate code that will service the API you created as it exists when you generate the scaffold.  If you add resources/endpoints to your api, you don't necessarily have to regenerate the scaffold, but if you don't you will have to add the code to service the endpoints manually.

      Imagine you start with an API called test with a GET resource called foo.  The scaffold would have code like this (unimportant parts deleted):

      <code>

      module.exports = function(service) {

        service.get('/mobile/custom/test/foo', function(req,res) {

        var result = {};

        var statusCode = 200;

        res.status(statusCode).send(result);

        });

      };

      </code>

      Now imagine you add 2 new resource, a POST to foo, and a GET to BAR.  You now how the option of regenerating the scaffold, or simply manually adding the necessary code to service the new endpoints.  You would need these two blocks:

      <code>

        service.post('/mobile/custom/test/foo', function(req,res) {

            var result = {};

            var statusCode = 201;

            res.status(statusCode).send(result);

        });

        service.get('/mobile/custom/test/bar', function(req,res) {

            var result = {};

            var statusCode = 200;

          res.status(statusCode).send(result);

        });

      </code>

      Notice how the way the endpoint is service is composed.  We see service.<httpVerb>(<endpointLocatoin>, function(req, res){ ........

      Given the information above, take a look at the zip file you uploaded that causes the problem.  Do you see the necessary code blocks in there? 

    • Bhargavi Chodisetti

      Hi,

      I am facing same issue, don't see any code mistake. Can you tell how did you resolve the issue.

      Existing method is working fine, newly added are not recognized. Simple method without parameters also not working.

      Thanks

    • Tom Ware

      This is currently not resolved.  'waiting on input from OTVian.

      I suggest either posting a separate thread about your issue in case it is different, or watching this one for a resolution.

    • Tom Ware

      I have recreated the problem.  We are working on a solution.  IN the meantime, you can workaround by updating the version of the API.

    • Anand Raj

      Hi ,
      Thanks for your reply .

      1. Your reply is about how to update the js file with the new endoints , right ? We are following the same way as mentioned by you .

              The issue comes when adding a new endpoint to an already working api .
              Please find an example using your code .

              The given endpoint (test/foo) is added during the api creation , it works perfectly fine .

              module.exports = function(service) {

                  service.get('/mobile/custom/test/foo', function(req,res) {

                  var result = {};

                  var statusCode = 200;

                  res.status(statusCode).send(result);

                  });

              };

                Issues comes when we add a new endpoint to the same api ( test/bar as the new endpoint ) In this case only test/foo will work and test/bar will           generate 404 Api not found error .

                <code>

                  service.get('/mobile/custom/test/foo', function(req,res) {

                           var result = {};

                           var statusCode = 200;

                           res.status(statusCode).send(result);

                  });

                  service.get('/mobile/custom/test/bar', function(req,res) { // New end point

                           var result = {};

                           var statusCode = 200;

                           res.status(statusCode).send(result);

                  });

                </code>

      2. Also tried using changing the version in package.json file . Its also not resolved my issue .

    • Anand Raj

      Hi 3272021 ,

      For me also existing endpoints are working fine . Newly added not working , giving 404 error

    • Tom Ware

      This is the official set of workarounds:

      1. Create new version of the API from MCS UI. Newly created version will have all the changes in RT.
      2. Export RAML and create new API from it. Newly created API will have all the changes in RT.
      3. Deploy API to staging/prod environment. In new environment the API will have all the changes in RT.

      The downside of each workaround is that it has to be performed every time between edit->test stages.

      For #1, in your UI under "APIs" select your API, click the "More" button and pick "Update Version Number."

      We expect to have a more permanent solution for this in the next few days.

    • Tom Ware

      The issue we found relates to new endpoints, so it sounds like it matches what you are seeing.

    • Anand Raj

      Hi ,

      Thanks for the update .
      The workaround that you mentioned is success,currently we are following your solution . But each time a when a new endpoint is added we have to create a new version also if the method changes then also we have to create a new version .
      Is there any alternate solution for this issue than updating the version each time?

      Thanks and regards

      OTVian

    • Tom Ware

      At the moment, the only workarounds we are aware of are the ones listed.  We are working hard on a permanent solution.

    • Anand Raj

      Please share with us once you got a permanent solution ...!

    • Tom Ware

      My understanding is that all full MCS versions were patched yesterday.

    • Anand Raj

      Let me check and will update you.