Thursday, January 13, 2011

Error when accessing XML Web service hosted in Windows Azure

Hi Folks,

I was developing a web role and i have a XML web service in my web role, I created a client application to access this web service. the client works on my development fabric. but after i deployed the web role in windows azure, I wasn't able to access the web service in the app fabric and i was getting this error:

{"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond MYAPP_IP:20000"}

The problem is the App Fabric doesn't allow any inbound http connections to any role in the App Fabric unless you specify an endpoint in the service definition file.

So, the solution is to define an endpoint in the service definition file with the port specified in the web role.

To do this:

1) From VS 2010 -> Right click on the role

2) Click on Endpoints from the role properties left tab and add your End Point:

Name: HTTPInWS Protocol: Http Port: 20000

3) Build and publish your web role.

5) Add a web reference in your client application and try to consume the web service.

You will be able to access XML web service function with no errors.

Note: You have to have Azure SDK V1.3 at least to define more than endpoint in your cloud role.

Hope this helps.

Mostafa Arafa

Tuesday, January 04, 2011

LoggedOut Event is not firing in the Login Control

Hi Folks,
Happy New Year 2011, This is my first post in this year. Hope everyone will have happy and promising year.
In this post i'm showing an issue i faced when i was working with the login control in ASP.NET.
If you tried to write code to clean up some resources when you log out from your application and you had an issue that the LoggedOut event handler is not firing.
Check the properties of your login control and if the Logout Action property is not set to Refresh, You need to update this property and set it to Refresh then your loggedout event will be handled.
I had the logout action property to redirect and that's why the loggedout event handler wasn't called in my code.

Hope this helps.