Question

REST ERROR in LSA EXERCISE : the server responded with an HTTP 404 code, indicating that the resource does not exist. // The service response contained insufficient data for mapping: The following header(s) were not populated: [etag]

I am performing the exercise steps under course “LEAD SYSTEM ARCHITECT” under lesson “Enhancing Hotel and Hotel Proxy applications”. I have already completed the previous required exercises before this one.

In this exercise, I am trying to verify the following highlighted steps to verify the work done.

  1. Create a Hotel case.
  2. Observe the Enter Data form. Make any optional changes and click Submit.
  3. Locate the attached Rooms Request for Event email correspondence at the Wait step within the Email Hotel step. Open the email to note the Hotel case pzInsKey (for example, FSG-HOTEL-WORK HOTEL-46).
  4. Wait for the Email child case to display on the Dashboard, and then open the case to confirm that it is at the initial assignment. Perform the same Email case testing as described in the Constructing the Hotel application exercise.
  5. Use either a second browser to log in to the Hotel Proxy application, or switch applications in the Application menu to change to the Hotel Proxy application.
  6. Use the App Explorer to identify and launch the most recently created Proxy case.
  7. Click Begin, enter the number of confirmed rooms, and click Submit.
  8. Reopen the Hotel case to confirm that the case is resolved, and that the case shows the number of confirmed rooms you entered into the Hotel Proxy case.

When I perform step 7, I am getting an error in REST call as below.

“the server responded with an HTTP 404 code, indicating that the resource does not exist. // The service response contained insufficient data for mapping: The following header(s) were not populated: [etag]”

Can someone please help explain whats the issue or what correction is required?

***Moderator Edit-Vidyaranjan: Moved from PSC to Academy***

Comments

Keep up to date on this post and subscribe to comments

Pega
October 22, 2018 - 6:48pm

The SOR Hotel case needs to be closed when the HotelProxy case attempts to update it. 

An HTTP 404 either means the resource either cannot be found or is not accessible.

When you trace the FSG-Hotel-Work-Hotel-Proxy ConfirmRooms Activity is the Interface.request.CASE_KEY correctly being set equal to the value of Primary.RoomsRequest.SORCaseKey in step 3?

You can also trace the api • v1 • cases REST service.

 

 

 

 

December 24, 2018 - 1:23pm

Hi team ,

 

I am facing the same issue . is it resolved ?

Could you please confirm .and let me know the solution .

Thanks

SB

Pega
December 24, 2018 - 2:17pm

The ConfirmRooms activity makes two REST calls to: pxRequestor.pxReqContextURI + "/api/v1/cases/{CASE_KEY}"

The value for CASE_KEY is Primary.RoomsRequest.SORCaseKey.  Look at the RoomReq REST Connector to see how CASE_KEY is used.

The first REST call is a GET. Looking at the RoomsReq REST Connector GET response you will see the eTag header value mapped to param.eTag.

Does the value for param.EndPointURL look correct?  Try entering param.EndPointURL's value in a browser which will issue a GET request.

The second REST call is a PUT.  Looking at the same Connector's PUT request you will see param.eTag used as the value for the If-Match header.

Try tracing the ConfirmRooms activity to see the value of param.eTag.

 

 

 

January 17, 2019 - 11:44am

Facing the same issue on the LSA Exercise. Proxy case gets created without problem using the POST. Also while updating the Hotel case from the proxy case, the GET correctly gets the etag, puts it in the param.etag and while PUT I see that the etag is also correctly passed into the If-Match Header.

But I still have this error coming up.

Strange thing is that If I use testing software like ARC for the same, it works and i see that the Hotel case is correctly updated with the new value for NumberOfRoomsConfirmed.

I copy the JSON body from the parameter page of the Connect-REST step, endpoint url and all details like the etag etc  are directly copied into ARC from the parameter page. And it works there!!!!!

JSON Request Body:

{
  "content": {
    "RoomsRequest": {
      "SORCaseKey": "FSG-HOTEL-WORK HOTEL-2",
      "EventStartDT": "20190120T110400.000 GMT",
      "NumRequested": 320,
      "ProxyCaseKey": "FSG-HOTEL-WORK C-3",
      "Email": "Joe.Fox@Marriott.com",
      "ResponseDeadlineDT": "20190118T110400.000 GMT",
      "Phone": "(617) 555-4567",
      "NumConfirmed": 123,
      "WhenToRequestDT": "20190116T110400.000 GMT",
      "ContactPerson": "Joe Fox",
      "Name": "JW Marriott"
    }
  }
}

http://192.168.56.102:9080/prweb/api/v1/cases/FSG-HOTEL-WORK HOTEL-2

Pega
January 17, 2019 - 12:02pm

One what system are your running Pega?  VM or Personal Edition?

Perhaps you are using a linux VM that has a firewall that prohibits port 9080 outbound?  (I am reaching here..).

Easy to check if you have "gufw" installed.

That or test from the VM command line using ping or telnet.

The IP address within the VM only needs to be 127.0.0.1 (local host).  

Granted that would be useless a production solution.

The code could be improved to obtain IP addresses using a Data Page or D-S-S.

 

 

 

January 19, 2019 - 3:20am
Response to PEDEL

Thanks a lot for a quick revert!! 

 I was able to solve this yesterday. When I traced the api-cases service I could see that the post activity (pxForceCaseClose) for the actionID =pyResolveAndCloseCase,  that is used as a stage local action, errors-out because, in step 2 it checks if the status being set to, starts with "Resolve". But I guess in the PUT request, we have not specified any value for the status post resolve, or may be I overlooked it.

So I changed the actionID to FSGChangeStage (Saved-as pyChangeStage local action) and passed the parameters it requires in the PUT body under content. (Audit note, stage name and stage action). This now, not only works as expected, but it also jumps to the resolve stage and closes the cases (instead of abruptly closing it from wait-shape) . It was working from ARC may be because I placed the actionID query-string in a wrong window under "variables". Hence it was only updating the case and not performing the local action.

Also for others who had problems with etag, it works without a problem. The GET gets the etag and passes it into Param.eTag and this Param nicely passes into the request header If-Match of the PUT.

Thank you!
Sushant Balur

P.S : PUT Request that worked:

{
  "content": {
    "AuditNote": "Jumped because HotelProxy responded-Sush",
    "GotoStage": "Resolve",
    "RoomsRequest": {
      "SORCaseKey": "FSG-HOTEL-WORK HOTEL-5",
      "NumRequested": 320,
      "EventStartDT": "20190126T001900.000 GMT",
      "ProxyCaseKey": "FSG-HOTEL-WORK C-6",
      "Email": "Joe.Fox@Marriott.com",
      "ResponseDeadlineDT": "20190124T001900.000 GMT",
      "NumConfirmed": 145,
      "Phone": "(617) 555-4567",
      "WhenToRequestDT": "20190122T001900.000 GMT",
      "ContactPerson": "Joe Fox",
      "Name": "JW Marriott"
    },
    "ChangeStageOption": "goto"
  }
}

January 31, 2019 - 11:24am
Response to SushantBalur

It seems that the actionID causes us some problems. Please see also this post:
https://community1.pega.com/community/pega-academy/question/lsa-73-exercise-creating-rest-integration-interface

 

Pega
February 12, 2019 - 3:40pm

I had the same problem and but faced an other issue with the first Connect-REST call in this activity.

The instructions say:

I think the end point URL should end with {CASE_KEY} instead of {CASE_Key} as the instructions say. Once I corrected this, the issue was gone.

August 22, 2019 - 7:04am

Hi,
I am implementing the Hotel application according to the LSA 7.3 Exercise. I have added parameter "actionID" in header. The issue is - the Hotel case is not being resolved from Hotel Proxy by REST api PUT. The Hotel Proxy case is being resolved.
While tracing the api/v1/cases, it goes up to GET service, PUT service is not being traced.
If I ommit the Get call and hardcode the eTag value, then PUT service is traced. But, I am getting a different error from PUT.
Is there anyway I can trace GET and PUT both services . Any help will be greatly appreciated.

 

 

September 16, 2019 - 5:28am
Response to DASN0001

i am also facing the same issue :(

August 31, 2019 - 8:06pm

I am having same problem. Hotel case is not resolving. However, I can see confirmed rooms value updated on the hotel case.

I tried with Sushant's approach as well but same result.

Has anyone found solution?