Tuesday, January 21, 2014

Cross Origin Resource Sharing

In release 7.3 we added a REST service endpoint named /MT/JSONServices to provide all sorts of asynchronous services to javascript functions running in browsers. These services can validate items, return TM tables, and in the latest releases even run UniBasic subroutines.

One BIG limitation with RESTful services has been the "Same Origin Policy" which was put in place for legitmate security concerns, but prevents sharing these really nice dynamic services across domains. How nice would it be to use Manage 2000 REST services to validate items in your third-party or self-rolled shopping cart application or CRM application or ...?

The W3C answer to this constraint is known as CORS (Cross Origin Resource Sharing) and has been supported in Chrome and Firefox for many releases, but has just recently gained full support in IE 10+.

You can implement CORS support through IIS custom headers, but I thought it would be nice to have a list of CORS approved sites in WEB.CONSTANTS where it can be more easily maintained by Manage 2000 account.  So Manage 2000 release 8.0 has a new screen in WEB.CONSTANTS for just this purpose and the /MT/JSONServices project has been updated to respond to CORS requests based on this list.




You will find example code on the JSONServicesTester page which you can run from the Development menu in the 8.0 release:


Monday, January 6, 2014

Manage 2000 Web Update from Frostbite Falls MN

Yes, it is MINUS -19F degrees today in balmy Minneapolis, with an expected HIGH of MINUS -15F degrees. Our EVPN authentication system decided it did not like my password this morning so I have some time to catch you up on Manage 2000 8.0 web development.

The 8.0 Beta is in progress and we have received and cashed-in our first treasure.  Beta startup drifted into the holidays and end of year, but I expect to be working on many more bug clean-up items over the next month or two in preparration for the GA cut.

In the mean time I am filling in my time with work on ASP.NET Health Monitoring.

The ASP.NET Health Monitoring system was developed by Microsoft and built into the ASP.NET 2.0 framework. By default it just pushes unhandled exceptions into the web servers event log.  But with a few web.config modifications you can coax it into sending emails to an administration email address with exceptions, heartbeat status reports, and custom health monitoring events.

I am putting together some doc on it for the WEB.ADMIN.COURSE and the SYS.WEB.HOWTOs menu. And I will leave my web.config settings from testing commented out in the release so that administrators can just uncomment sections, replace a couple of parameters, and experiement with this nice monitoring system.

There is another popular monitor for unhandled exceptions named ELMAH.  I played with this guy a little bit too. He can be added to existing web sites easily and does a nice job of presenting unhandled exceptions to the administrator through RSS feeds or a web interface.  But ELMAH does not seem to offer any custom extensibility options to instrument the Manage 2000 web site.

So I am sticking with ASP.NET Health Monidoring and adding a custom Manage 2000 Health Monitoring event in release 8.0 that can poll the Unidata box and let the administrator know if Redback goes down.