It's all about the answers!

Ask a question

Javascript is either disabled or not available in your Browser


Lipi Das (2612535) | asked Mar 08 '17, 4:48 a.m.

I am getting a html response instead of xml response when I am running a code to read the catalog response saying Javascript is either disabled or not available in your Browser

I get proper xml response using the same credentials on REST Client on Firefox.

CLM version used is 6.0.3

<body class="claro">
 <noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is either disabled or not available in your Browser</div></noscript>
 <div id="net-jazz-ajax-InitialLoadMessage">Loading...</div>
 <div id="net-jazz-ajax-WorkbenchRoot"></div>
 
 <script type="text/javascript">
  djConfig = {
   isDebug: false,
   layout: "",
   usePlainJson: true,
   baseUrl: "/jts/web/dojo/",
   locale: "en-us",
   localizationComplete: true
  };
  /*null*/
  net = {jazz: {ajax: {}}};
  net.jazz.ajax._contextRoot = "/jts";
  net.jazz.ajax._appPath = "/jts/auth/authrequired";
  net.jazz.ajax._webuiPrefix = "/web/";
 </script>
 

Code snippet below

XPath catXpath = factory.newXPath();
    catXpath.setNamespaceContext(new RRCconfigNamespaceContextMap(new String[]
      { "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
      "oslc_rm","http://open-services.net/xmlns/rm/1.0/"}));
   
    // Parse the response body to retrieve the catalog URI
    InputSource source = new InputSource(rootServicesResponse.getEntity().getContent());
    Node catalogNode = (Node) (catXpath.evaluate(catalogXPath, source, XPathConstants.NODE));
    String serviceProvidersCatalog = catalogNode.getTextContent();
    rootServicesResponse.getEntity().consumeContent();
    System.out.println("serviceProvidersCatalog "+serviceProvidersCatalog);
  
    // Setup the catalog request
    HttpGet catalogDoc = new HttpGet(serviceProvidersCatalog);
    //catalogDoc.addHeader("Accept", "application/rdf+xml");
    //catalogDoc.addHeader("OSLC-Core-Version", "2.0");
    
    catalogDoc.addHeader("Accept", "application/rdf+xml");
    catalogDoc.addHeader("OSLC-Core-Version", "2.0");
   // Access to the Service Providers catalog
    HttpResponse catalogResponse = RRCconfigrHttpUtils.sendGetForSecureDocument(server, catalogDoc, login, password, httpclient,jtsServer);
     RRCconfigrHttpUtils.printResponseBody(catalogResponse);
    if (catalogResponse.getStatusLine().getStatusCode() == 200) {
        XPath spXpath = factory.newXPath();
       spXpath.setNamespaceContext(
      new RRCconfigNamespaceContextMap(new String[]{"rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#","oslc", "http://open-services.net/ns/core#",
          "dcterms","http://purl.org/dc/terms/","oslc_rm","http://open-services.net/xmlns/rm/1.0/"}));
    
     // Parse the response body to retrieve the Service Provider
       RRCconfigrHttpUtils.printResponseBody(catalogResponse);


Comments
Ralph Schoon commented Mar 08 '17, 10:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I have very few knowledge about OSLC and JavaScript, but this looks to me like you are not authenticated to the system and you basically get the JTS login page back:


  net = {jazz: {ajax: {}}}; 
  net.jazz.ajax._contextRoot = "/jts"; 
  net.jazz.ajax._appPath = "/jts/auth/authrequired"; 

  net.jazz.ajax._webuiPrefix = "/web/";  


I have had similar issues when not being logged in and using a REST Client. Just a thought.


1
DUm Dum commented Jan 09 '18, 11:00 a.m. | edited Nov 02 '18, 10:22 p.m.

 Were you able to solve your problem. If Yes can you please guide me how to rectify this issue.



Thank you

Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered Dec 01 '17, 7:23 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Correct, this HTML content is the web login page for RQM.  You need to be authenticated with the RQM server before making any OSLC requests. 

Ralph Schoon selected this answer as the correct answer

Comments
srinivasan n commented Nov 01 '18, 5:14 a.m. | edited Nov 02 '18, 10:22 p.m.

Is there an article that explains how to be authenticated with the RQM server ?


Ralph Schoon commented Nov 01 '18, 5:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

3 other answers



permanent link
Guido Schneider (3.4k1486115) | answered Dec 11 '17, 3:45 p.m.
edited Dec 11 '17, 3:45 p.m.

I always see this "error" if the URL is in the wrong security zone.


permanent link
Ralph Schoon (63.1k33646) | answered Nov 01 '18, 5:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 See https://jazz.net/library/article/635 and understand that a REST client embedded in the browser caries the authentication headers and cookies over.


permanent link
Paul Slauenwhite (8.4k12) | answered Nov 01 '18, 6:05 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.