Blog to discuss Midnight Coders products features, ideas and trends in development of Rich Internet Applications

Thursday, December 04, 2008

WebORB 3.6 for .NET is available

If you're working with the .NET version of our product, we have some news for you. There is a new release with some important features as well as bug fixes. See below for details:
  • Support for Silverlight client - Includes client-side component with remoting APIs, code generator integrated into the management console as well as a command line code generation utility. Silverlight integration makes it super simple to invoke methods on remote objects as well as SOAP/REST web services. Btw, Silverlight integration works across all WebORB implementations thus you can connect Silverlight with .NET, Java, PHP and soon ColdFusion components.

  • Support for server-to-server AMF invocations - Previous release made it possible to do server-to-server (or process-to-process if you will) invocations via RTMP. With 3.6 you can accomplish the same using AMF over HTTP. This should allow cross-platform integration where .NET can invoke Java or native .NET apps can call each other using simple and intuitive API without all the complexities associated with cross process integration.

  • WebORB Visual Studio templates - Many of you asked for it and we listened. The product installer registers Visual Studio templates with your installation of VisualStudio 2005 and 2008 (whichever you have installed). The templates are available for C# and Visual Basic. There are two types of templates: one to create WebORB-enabled website projects and the other is for WebORB-enables class libraries. We put together a few screencasts demonstrating the templates in action:
    Using WebORB Visual Studio templates - Part 1
    Using WebORB Visual Studio templates - Part 2

  • Custom MSMQ queue factories support - When using Producer/Consumer APIs with the messaging destinations connected with MSMQ, you may have a scenario when you need to construct instances of the queue in your own code. WebORB now supports custom queue factories to support this use-case. See the comments in WEB-INF/flex/messaging-config.xml (the <queuefactory> element)

  • Class mappings between abstract generic collections and concrete implementations - Suppose you have a remoting method that declares an abstract generic argument:

    public void processOrders( IList<Order> orders )
    {
    }

    Since the argument is an abstract type, WebORB would need to know what concrete generic implementation should be used for that IList. The new release provides a way to establish mappings between abstract generic types and a concrete implementation. See <abstractclassmappings> section in weborb.config for more details.

  • Bug fixes:
    - Fixed a bug with reference serialization. The error was resulted in a message "Error #2006: The supplied index is out of bounds"
    - Fixed a bug with AJAX remoting and Firefox 3
    - Fixed a bug with serialization of very large data sets
    - Fixed a bug with passing credentials in AJAX invocations
As always, we love to get feedback. Please drop us a line and let us know what we could do better or differently.

We have a new website - come check it out!

The stack of topics I want/need to blog about is experiencing a major overflow, so I'll start in the chronological order.

If you have not been to our website lately, I recommend you check it out: http://www.themidnightcoders.com

We have completely redesigned the site and I am very pleased with the new design. Unlike all previous versions of our site, we now have a CMS system. It is not perfect, but certainly a major step forward from where we were. The new site should make it easier to find information about the products and services we provide. We're also incorporating a commenting system for the pages with technical information (like technotes, articles and screencasts). If you see something we might have missed or should improve, we'd love to hear from you.

Also, just for fun I used the Web Archive to see what the site looked like in the past. Below are the thumbnails of the home page versions going back to 2003 when I launched the company and created the very first version of the site:

Version 1 (2003):


Version 2 (2004):

Version 3(2005):


Version 4(2007):


Version 5 (current)

Wednesday, November 05, 2008

Wade Arnold says - "WebORB is way cooler than AMFPHP"

Wade Arnold (who currently maintains the AMFPHP project and was hired by Adobe to write ZendAMF) recently gave an interview on The Flex Show. The interview touched upon several interesting points. Among them was when the host of the show asked Wade to compare ZendAMF with AMFPHP and WebORB. In the response Wade said:

"WebORB is WAY cooler than AFMPHP".

I could not agree more with you, Wade. Thank you for your honest answer.

One other thing was mentioned that PDF Generation is not something that WebORB will ever do. This is wrong and very soon we're going to announce some fantastic PDF Generation tools for .NET, Java and PHP. Stay tuned!

You can listen to the interview on the Flex Show site. The interesting part starts at 32 minutes and 17 seconds into the interview

Wednesday, October 29, 2008

WebORB for Java 3.0 is released

I am very happy to announce that WebORB for Java version 3.0 is released into production. It took us very long time, but I am sure the wait was worth it. The product has gone through extensive testing and the final release is full of cool features. Below is a summary of the most notable ones:
  • Product installer. WebORB now comes with the installer. When you download the product, you get weborb4java.jar. You can install the product by running the following command: java-jar weborb4java.jar
  • Silverlight integration. Silverlight client is now an equal citizen among other rich client technologies WebORB supports. In fact, WebORB is the only product to my knowledge that provides the level of integration between Silverlight apps and Java POJOs, Spring Beans, and EJBs. The product includes a Silverlight client library you can import into Visual Studio projects which will enable remoting between SL and Java. Additionally, the product includes Visual Studio templates to make it easier to get started with Silverlight, Java and WebORB
  • Real-time Messaging integration. The installer provides an option to add real-time messaging support. When installed, the featureset includes support for data push, client synchronization for data management, remote shared objects, pub/sub support without polling as well as streaming video.
  • Significant Data Management improvements. There are major improvements in stability and code generation performance. The system has been tested on a variety of database types as well as data types.
  • ActiveMQ integration. In general, WebORB integrates with any JMS implementation to provide publish/subscribe messaging. Specifically with ActiveMQ, the product makes it easy to get started as it includes all the special configuration options as well as ActiveMQ messaging broker itself.

In the upcoming weeks and months we plan to roll out several major products. WebORB for Java is a key element of our product strategy. We also plan to publish comparisons between WebORB for Java and other alternatives to make it easier for you to see how much more superior our technology is.

Tuesday, October 14, 2008

Google maps, Flex data push and 2008 Elections

What do these three have in common? We put together a non-scientific US presidential elections simulation using WebORB for .NET and Google maps. The application is running at:

http://dev.themidnightcoders.com/elections/main.html

As users cast their votes, the server tallies the results and notifies all connected clients using WebORB data push. We used WebORB for .NET for this example, however WebORB for Java could easily fit the bill the as well. We have done several projects where we used Google Maps, Flex and WebORB and it has been rather enjoyable experience. Please pass the URL along and watch the election numbers update automatically.

Monday, September 15, 2008

WebORB for PHP 3.5 (Data Management for Flex plus Silverlight integration)

I am proud to announce immediate availability of WebORB version 3.5 for PHP. This new release delivers a bunch of very cool and powerful functionality.

First, we added support for Data Management for Flex (WDMF). The feature includes a code generator and a runtime environment. The codegen creates client-side (ActionScript) code AND server-side PHP code to do full blown CRUD directly from the Flex client application. Our professional services team have implemented several projects using WDMF and the speed of development is phenomenal. Without writing a single line of code, you get about 90% of the backend code plus a fantastic framework for creating custom data-driven rich client application. You can see a screen cast at the following URL:
http://www.themidnightcoders.com/weborb/php/videos/wdmf/overview

Second, WebORB has always been a client-agnostic technology. We support Flash, Flex, AJAX and now we have added support for Silverlight. The release of WebORB for PHP includes a Silverlight component you can use in your Silverlight application to connect and invoke PHP classes without all the complexity typically involved with Silverlight remoting. All you need to do is to deploy a PHP class into WebORB and the product automatically handles all the marshalling and unmarshalling, type adaptation, etc. We included several examples demonstrating Silverlight talking to PHP using WebORB into the 3.5 product distribution. You can see them all on the Examples tab in the management console. There's also a walk through guide available at:
http://www.themidnightcoders.com/weborb/php/silverlight_and_php.shtm

There are several bug fixes included into the release, so be sure to check WebORB for PHP 3.5 out. If you have any questions about the product, you can post them to the discussion forum. Additionally, we have a knowledge base and for those who wants to receive professional support, check out our support packages.

Friday, September 12, 2008

Running Zend Core with Apache

I just had to go through a rather painful exercise of configuring Zend Core to run with Apache. The initial experience was promising as the installer asked a bunch of questions, but then just hung in the taskbar without a window. The installer has gone far enough to actually download and install the Apache server on my system. However, it didn't get to the point to configure the Apache web server to handle the execution of the PHP scripts. I went through the pain of figuring it out, so if you're in the similar situation, read on as the resources on the web are very scarce and Zend does not publish any clear instructions on how to configure their product to run under Apache. The instructions assume that you accepted all the default values during the installation (specifically the installation path - C:\Program Files\Zend)

  1. The Apache web server uses httpd.conf configuration file. The file is located in C:\Program Files\Zend\Apache2\conf. Open the file and add the following configuration (does not matter where, I added at the bottom):

    LoadModule zend_enabler_module "C:/Program Files/Zend/Core/modules/apache2.2/zend_fcgi.dll"
    FastCgiConfig "C:/Program Files/Zend/Core/etc/fastcgi.conf"
    AddHandler fastcgi-script .php .php3 .phtml .inc
    AddType application/x-httpd-php .php .php3 .phtml .inc
    <Location>
    Order deny,allow
    Allow from all
    </Location>
    Alias /ZendCore "C:/Program Files/Zend/Core/GUI"


  2. The configuration above references application/x-httpd-php mime type, which should be registered in mime.conf located in the same directory as httpd.conf (C:\Program Files\Zend\Apache2\conf). Add the following line in mime.conf:

    application/x-httpd-php php php3 phtml inc

  3. There is a reference to fastcgi.conf in the configuration added in step 1. I am not familiar with FastCGI, so it was the biggest pain to find a sample for that file as Zend does not provide one. Create a text file with the name fastcgi.conf in the following directory C:\Program Files\Zend\Core\etc. The file must have the following content:

    Server type="application/x-httpd-php" CommandLine="C:\Program Files\Zend\Core\bin\php-cgi.exe" ConnectionTimeout="240" RequestTimeout="360" StartProcesses="16" Impersonate="1" SetEnv="PHP_FCGI_MAX_REQUESTS=10000" SetEnv="PHP_FCGI_CHILDREN=1" SetEnv="PATH=?" SetEnv="TEMP=C:\Program Files\Zend\Core\temp" SetEnv="OS=?" SetEnv="SystemRoot=?" SetEnv="ComSpec=?" SetEnv="DB2INSTANCE=?"
    MinDynamicServers 8
    MaxDynamicServers 32
    IpcDir "C:\Program Files\Zend\Core\temp"


    IMPORTANT: For the configuration shown above, make sure the file has only FOUR lines: one that starts with "Server", followed by "MinDynamicServers", "MaxDynamicServers" and "IpcDir". So all the line breaks in the "Server" line must be removed, otherwise configuration processing will fail.

  4. The document root for your PHP code is C:\Program Files\Zend\Apache2\htdocs. If you are deploying WebORB, this is where the zip file must be extracted to. To test if PHP is working, place a test script (call it test.php) with phpinfo() into htdocs. Start (or restart) the Apache server and load it from http://localhost/test.php
    Here's a sample of test.php:

    <?php
    phpinfo();
    ?>

  5. Finally configuring php.ini requires a few extra steps. It is still a mystery for me what algorithm PHP/Zend uses to locate php.ini, but generally speaking copying it to your /Windows directory works. Notice that php.ini that comes with Zend does not enable any extensions, so you'd have to do it by yourself.
If you had a similar experience configuring your system with Zend and Apache, I'd be interested to hear how it went.

The really cool news though is that WebORB runs absolutely flawlessly under Zend Framework, including service browser, test drive and our brand new data management implementation.

Monday, September 08, 2008

Debugging PHP code when invoked from Flex

Among thousand other things we have been doing quite a bit of work on WebORB for PHP lately. One of the most unpleasant things in PHP is the complete lack of normal debugging tools (at least I could not find any decent debuggers that would work for me). As a result, when PHP is invoked from a rich client like Flex, one must get very creative in order to tap into the PHP invocation flow and debug it. The reason traditional echo() does not work is it would mess up the binary output created by the gateway. There are several techniques I found to be very effecive. Below is the full list:

  1. Use native PHP logging. PHP has fairly rich system for error reporting which could be used to log any kind of messages (not just errors). It is important to make sure that your PHP process (or the process running PHP, like IIS/ISAPI for instance) have enough permissions to write to files. Then modify your PHP.INI and enable the following properties: (you can find out where your PHP.INI is by running a PHP page that executes phpinfo())
    log_errors = On
    error_log = C:\some-directory-path\errors.txt
    Once you changed PHP.INI, restart your PHP process and you should be able to log your own errors. There's a function that lets you do that: error_log. For instance, the following line will save a string in the error log file:

    error_log( "yo, log this message",  0 );
    To get a detailed view of a complex type or an array, use print_r, but make sure to pass the second parameter to capture the value. For instance:

    $a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
    error_log( "contents of the array are " . print_r($a, true), 0 );


  2. Use WebORB Management Console. The console has a feature called Test Drive. Once you deploy your code into the /services folder, you will see your class in the Management > Services tab. Locate the class, expand it and select the method you want to invoke. You will be able to enter argument values right on the screen and invoke the method using the "Invoke" button.

  3. Use Charles or ServiceCapture proxies. Either one of these tools is a MUST for anyone developing an RIA. You can see all the traffic between your rich client running in a browser and the server. Moreover, the tools decode the binary traffic and display invocation and response structures in a tree view format. If you are getting Channel Disconnected error, make sure to inspect the server (PHP) response with one of these tools. (I should probably repeat that 10 times, so it is implanted into the brains of Flex/PHP developers).

  4. Use WebORB logging. WebORB logging provides more granular control over what gets logged. You can also enable/disable individual loggers in the management console (Management > Server Configuration > Logging). WebORB logging dumps the log messages into a file under /logs folder (located in the weborb installation directory). Using the logging API is fairly straightforward. First "import" the classes using:

    require_once(WebOrb . 'Util/Logging/Log.php');
    require_once(WebOrb . "Util/Logging/LoggingConstants.php");

    Then you can start logging using the following call:

    Log::log(LoggingConstants::INFO, "your message or object here" );

    There are several logging categories available, see Util/Logging/LoggingConstants.php for details. Each category can be turn on/off in the management console.

If you have any tips and tricks for PHP/Flex debugging, please post your comments.