Showing posts with label web server. Show all posts
Showing posts with label web server. Show all posts

Saturday, April 30, 2016

Avoiding EventService problem

Problem Statement :

Avoiding the problem, "Event channel is unable to connect to web server. Do you want to reconnect?".

Kiran : Hey Champ, I am trying to build an application in cordys and I am facing a problem.

Champ : What is the problem that you are facing?

Kiran : There is no error while accessing cordys application, but this confirmation box keeps popping up every now and then only to increase irritation.

Champ : I did not get you :( 

Kiran : That error which is shown below,


Champ : That is not an error right? You can simple click "Yes" whenever it pops up. Wouldn't that solve the problem?

Kiran : Yes, that would solve the problem temporarily. Can I fix it permanently?

Champ : Ohh Yes, You can!!!! First tell me, Can you see any error in the debugging tools of the browser? You must be telling me something so that I can solve your problem.

Kiran : Yes, It is trying to download some of the resource and it is failing because of some ERR_HOST_NAME_ERROR or something. I don't remember exact error but what I do remember is that there is definitely a problem with the hostname. I am using the application using the IP Address.

Champ : Thank you!! That information really helps. Now can you try from the command prompt to ping the hostname and as well as the ip address that you are trying to connect. Then let me know the results.

Kiran : I am able to get a response from ping to IP Address but not to the hostname.

Champ : Look!!!! This is the problem. Your system is not able to look up the hostname for the IPAddress that you are connecting.

Kiran : What should I do for solving this problem?

Champ : Okay!!

  • Go to the mentioned folder and locate "hosts" file, shown below,


  • Then edit hosts file with an entry similar to below, 



  • Remember, 192.168.50.19 is my local intranet IP address and the host names are also mine. Don't prove yourself dumb by just copy pasting the same whatever I have shown. Use your brain please.
Kiran : You must be kidding!!!! Anyways thanks for your help champ. I understood the problem and it solved it :) See you again!!!!!! 



Friday, August 1, 2014

Learnings from CORS : Call a webservice from other domains

Problem Statement :

We generally encounter a scenario where we have to access services which are not hosted locally (i.e., Other domain). This normally can't be achieved straight forwardly in html. We need to understand few points here which I will be explaining in this post.

References :

Explanation :

I would go with the assumption that one must know how to call a web service from html. If not the above reference would help in achieving this.

Note : A clear information that this is not possible in latest versions of chrome (I have tested only with browsers chrome and IE). This post is not meant for the applications which is using latest versions of chrome (http://bugs.jquery.com/ticket/4690 post would help you understand why).

Lets say you are using the same html file which is being explained in this post. Only difference being the gatewayURL which is the end point url being different.

How to solve it in IE :

Be it XMLHttpRequest or ajax request you can access services of cross domain using a browser property (this again depends on every client and also not secure). The property is as shown below in the image,



 After enabling this option one can access cross domain services in IE.

How to Enable in Chrome lower versions (I have chrome 16):

Although new versions of chrome doesn't support cross domain services at all but this can be achieved for lower versions of chrome using concept called "CORS". CORS stand for Cross Origin Resource Sharing. 

In Simple terms "Server has to authorize the client for cross domain accessing in case of chrome". This is not happening in IE as this is enabled at client side using settings of IE.

Problems/Resolution :

Possible errors from Chrome 16 are shown below :



Add below two properties to the website that you are using :

"Access-Control-Allow-Headers" with value "Content-Type"
"Access-Control-Allow-Origin" with value "*" (* generally represents allow any domain you have to google on how to give multiple domains, in general one domain is http://dhl-hyd1024)