search&promote facet flow expects json while seach is working with xml response

Avatar

Avatar
Validate 25
Level 3
asn_177
Level 3

Likes

4 likes

Total Posts

88 posts

Correct reply

1 solution
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 25
Level 3
asn_177
Level 3

Likes

4 likes

Total Posts

88 posts

Correct reply

1 solution
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 3
Boost 1
View profile
asn_177
Level 3

21-09-2016

We are using search&promote for seach on our site.

The usage is prettymuch inline with the OOTB searchpromote components in libs/cq/searchpromote path.

We receive an XML from s&p server.

We now are looking at having facets, I tried putting linklist facet on results page to get facets but it failed, so looking at logs and going through jar I noticed that facet component in its dialog calls a servlet (path+facetList.json) this servlet calls searchpromoteservice's get facetList method.


      String facetList = this.searchpromote.getFacetList(memberId, accountNo);
      JSONObject facets = new JSONObject(facetList);
      out.write(facets.toString());

but it then tries to convert string response as JSON object and fails since the URL http://sp10050b5b.guided.ss-omtrdc.net/design/sp_id=MyID-MyAccount&sp_fn=facets results xml rsponse.

Only changing this setting in search & promote to return json would suffice or I will have to make any other changes as well?

 

Regards,

Allhad

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

30-09-2016

Hi ,

You should make sure that the XML that it is received is the AEM XML  https://marketing.adobe.com/resources/help/en_US/snp/r_gsxmloutputforwem.html, not the normal XML. Also, it is not clear that which version of AEM your are sing . Actually is AEM code calling S&P, so the you should put the question in the AEM forum or contact support. you  should not modified the templates in S&P to return JSON and you  eed to re-write the AEM components to read them correctly, basically implement all S&P components.

Thanks & Regards

Parit Mittal

Answers (0)