<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged web-service</title>
<link>https://overflow.efficy.io/?qa=tag/web-service</link>
<description>Powered by Question2Answer</description>
<item>
<title>Error when making rest calls on https</title>
<link>https://overflow.efficy.io/?qa=2135/error-when-making-rest-calls-on-https</link>
<description>&lt;p&gt;Hello everyone, &lt;/p&gt;

&lt;p&gt;For one of my customer (Ingenico) I have to communicate with another api using rest call (Method; POST) to synchronise Efficy's tickets/actions. &lt;/p&gt;

&lt;p&gt;During my first tests, I encountered some errors due to the invalid certificate (It's expired since 2015). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First version:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;//@Author: PPT: Create HTTP request
function createRequest() {

  return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
}

function SendCaseToJira(k_case){

                var url = Database.GetSysStorageValue('Jira_ApiUrl') + &quot;update/case/&quot; + k_case;
                var req = createRequest();
                try{         
                                var ret;
                                var OnSuccessFunction = function (args2, _html) {ret=_html;}                                    
                                req.onreadystatechange = function() {
                                  if (req.readyState == 4 &amp;amp;&amp;amp; req.status == 200) {
                                                OnSuccessFunction(&quot;&quot;,req.responseText);
                                  }else
                                                  ret = &quot;not working&quot;;
                                };
                                req.open(&quot;POST&quot;, url, false);
                                req.send();

                                Logger.Write(ret);
                }catch(e){
                                Logger.Write(&quot;Error when notifying Jira: &quot; + e.message);
                }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is the error message that I was getting: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Error when notifying Jira: Security certificate required to access&lt;br&gt;
  this resource is invalid.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I found that I could disable certificate check by modifying my code: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second version:&lt;/strong&gt; &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;//@Author: PPT: Create HTTP request
function createRequest() {

  // return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
  return new ActiveXObject(&quot;Msxml2.ServerXMLHTTP.3.0&quot;);
}

function SendCaseToJira(k_case){

                var url = Database.GetSysStorageValue('Jira_ApiUrl') + &quot;update/case/&quot; + k_case;
                //var url = Database.GetSysStorageValue('Jira_ApiUrl') + &quot;update/&quot;;
                var req = createRequest();
                //Disable the certificat check
                req.setOption(2, 13056);
                try{         
                                var ret;
                                var OnSuccessFunction = function (args2, _html) {ret=_html;}                                    
                                req.onreadystatechange = function() {
                                  if (req.readyState == 4 &amp;amp;&amp;amp; req.status == 200) {
                                                OnSuccessFunction(&quot;&quot;,req.responseText);
                                  }else
                                                  ret = &quot;not working&quot;;
                                };
                                req.open(&quot;POST&quot;, url, false);
                                req.send();

                                Logger.Write(ret);
                                //Logger.Write(&quot;Success notifying Jira: &quot; + response);
                }catch(e){
                                Logger.Write(&quot;Error when notifying Jira: &quot; + e.message);
                }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And now I'm getting the following error: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Error when notifying Jira: An error occurred in the secure channel&lt;br&gt;
  support&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Have someone ever had that kind of problem? Can someone help me on how to generate rest call over https using javascript serverside? &lt;/p&gt;

&lt;p&gt;Thanks in advance. &lt;/p&gt;

&lt;p&gt;KR, &lt;/p&gt;

&lt;p&gt;Prince.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2135/error-when-making-rest-calls-on-https</guid>
<pubDate>Wed, 21 Dec 2016 12:31:30 +0000</pubDate>
</item>
<item>
<title>Calling a web service through a proxy server in serverside script</title>
<link>https://overflow.efficy.io/?qa=2064/calling-web-service-through-proxy-server-serverside-script</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;we come across a problem that we have to call a web service through a proxy server. Has someone done this before?&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;
Jeroen Floor&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2064/calling-web-service-through-proxy-server-serverside-script</guid>
<pubDate>Thu, 01 Dec 2016 16:37:32 +0000</pubDate>
</item>
</channel>
</rss>