title: IBM Worklight 6.0 - Getting Error while invoking adapter procedure
body: <p>I am following training module <code>04_02_HTTP_adapter_-_Communicating_with_HTTP_back-
  end_systems</code>, available on IBM Worklight Getting Started website, and when invoking a procedure it gives me an error:</p>
  
  <pre><code>{
      "errors": [
          "Runtime: Http request failed: java.net.UnknownHostException: rss.cnn.com"
      ],
      "info": [
      ],
      "isSuccessful": false,
      "warnings": [
      ]
  }
  </code></pre>
  
  <p>Adapter -impl.js</p>
  
  <pre><code>function getStories(interest) {
      path = getPath(interest);
  
  var input = {
      method : 'get',
      returnedContentType : 'xml',
      path : path
             };
  
  
     return WL.Server.invokeHttp(input);
                }
  
        function getStoriesFiltered(interest) {
     path = getPath(interest);
  
       var input = {
           method : 'get',
           returnedContentType : 'xml',
           path : path,
           transformation : {
          type : 'xslFile',
          xslFile : 'filtered.xsl'
         }
      };
  
     return WL.Server.invokeHttp(input);
         }
  
  
  
        function getPath(interest) {
          if (interest == undefined || interest == '') {
      interest = '';
            }else {
      interest = '_' + interest;
           }
             return 'rss/edition' + interest + '.rss';
                     }
  </code></pre>
  
  <p>XML file</p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
     &lt;wl:adapter name="RSSReader"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:wl="http://www.worklight.com/integration"
  xmlns:http="http://www.worklight.com/integration/http"&gt;
  
  &lt;displayName&gt;RSSReader&lt;/displayName&gt;
  &lt;description&gt;RSSReader&lt;/description&gt;
  &lt;connectivity&gt;
      &lt;connectionPolicy xsi:type="http:HTTPConnectionPolicyType"&gt;
          &lt;protocol&gt;http&lt;/protocol&gt;
          &lt;domain&gt;rss.cnn.com&lt;/domain&gt;
          &lt;port&gt;80&lt;/port&gt; 
  
      &lt;/connectionPolicy&gt;
      &lt;loadConstraints maxConcurrentConnectionsPerNode="2" /&gt;
  &lt;/connectivity&gt;
  
  &lt;procedure name="getStories"/&gt;
  
  &lt;procedure name="getStoriesFiltered"/&gt;
  
       &lt;/wl:adapter&gt;
  </code></pre>
  
  <p>ahha, finally I got my answer. I did some proxy settings in the XML file and my adapter started working. Here is the Proxy code that one must add if they are using any Proxy.</p>
  
  <pre><code> &lt;connectionPolicy xsi:type="http:HTTPConnectionPolicyType"&gt;
   &lt;protocol&gt;http&lt;/protocol&gt;
   &lt;domain&gt;rss.cnn.com&lt;/domain&gt;
   &lt;port&gt;80&lt;/port&gt;
   &lt;proxy&gt;
   &lt;protocol&gt;http&lt;/protocol&gt;
   &lt;domain&gt;proxy.My_company_name.com&lt;/domain&gt;  ----use proxy URL here
   &lt;port&gt;8080&lt;/port&gt;
   &lt;authentication&gt;
   &lt;basic/&gt;
   &lt;serverIdentity&gt;
   &lt;username&gt;user&lt;/username&gt; --------user is username
   &lt;password&gt;password&lt;/password&gt; ------------Proxy Password 
   &lt;/serverIdentity&gt;
   &lt;/authentication&gt;
   &lt;/proxy&gt;
   &lt;/connectionPolicy&gt;
  </code></pre>