1

We are using Java DXA-2.2.5 and Model service to render content, we came across one issue when we request for page model, it says 400 bad request since it is not able to understand encoded page url.

we have url -

http://localhost:8080/system/include/header.html

I did analyze dxa-model-service-client

Its failing on ModelServiceClient.java where URL is passed as parameter

ResponseEntity<T> response = restTemplate.exchange(serviceUrl, HttpMethod.GET, new HttpEntity<>(null, headers), type, params);

here is property from properties file

dxa.model.service.url.page.model=/PageModel/{uriType}/{localizationId}/{pageUrl}?includes={pageInclusion}

where on {pageUrl} if there is "/" characters comes it changed to %2F and then passes as request, which results 400 bad request

Failed url:

http://test.content-delivery.com:8998/PageModel/tcm/8/system%2Finclude%2Fheader.html?includes=INCLUDE

I have tried with postman call as well this URL doesn't provide response.

I tried it by changing URL to where I replaced %2F with "/" on postman request

http://test.content-delivery.com:8998/PageModel/tcm/8/system/include/header?includes=INCLUDE

I could see response on postman call.

could someone please tell me how could I use dxa-model-service-client to make it working on dxa-2.2 application. Any pages under different structure groups having the issue.

2
  • which version of tridion sites? and what is the version of model-service?
    – Velmurugan
    Commented Oct 2, 2020 at 9:55
  • Hi Velu, it is sites-9.5, I could see response when i check from postman after replacing %2F to "/". it looks to me that it is something with dxa-model-service-client Commented Oct 2, 2020 at 9:59

1 Answer 1

1

I'm not sure why that URL escape happends in this case, you might need to debug in the web application to see why that URL calls passes like that to modelsevice.

On Sites 9.5, you should preferably use the GraphQL Content Service + DXA Model Extension instead of the standalone Model Service. For more details please follow the link.

I didn't had a chance to test Sites 9.5 against Model service, but I can confirm that OOTB DXA 2.2.5 Java + DXA Model extention it works as expected in Sites 9.5.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.