Categories

  • An excellent post on delivering real-time updates from .NET to JavaScript via WebSockets by using WebORB for .NET: http://t.co/8ONjyw59
  • We're working on some cool samples demonstrating Sencha component integration with WebORB's websockets and data management. Stay tuned.
  • For all Flexers out there, check out the following blog post, looks like a problem in ArrayCollection serialization: http://t.co/qbZuTEhy
  • none - intentionally blocks websocket handshake responses. Not only they do not support it, they do not allow others either

Archives

WebORB v4.3 for Java is Released!

I am very happy to report that we released a new version of WebORB for Java – version 4.3. The theme of the release is ‘Developer Productivity’. As you may already know, WebORB enables integration at four different levels: remoting (RPC), data management, real-time publish/subscribe messaging and video/audio streaming and recording. With this release, we deliver code generators for all of these levels of integration. Below is a brief description of the new features you will find in 4.3:

  • Data management for JavaScript Clients – If you’re familiar with WebORB, more than likely you know about our data management framework. If not, then you can learn about it either from the WebORB Data Management documentation or the Data Management webinar recording. In short, the framework lets you quickly import your database schema into our Data Modeller tool and generate client and server-side code to enable full CRUD with your data from the ActionScript or JavaScript client or the server-side code. The same code generator can also create a demo application which demonstrates the power of the API. The JavaScript client support lets you create a data-driven ORM solution for your database in seconds. In addition to the APIs for CRUD operations, the JavaScript client also supports client-synchronization for the changes done by other clients working with the same dataset.
  • Remoting code generator for Robotlegs - Robotlegs is quickly becoming a popular ActionScript framework. We included a very powerful code generator which can generate all the supporting ActionScript classes for a given Java service (POJO, EJB, Spring bean, Grails service or SOAP web service) . The generated code enables remoting with the service and includes all the supporting classes conforming to the Robotlegs framework. This includes controller, events, mediators and ActionScript value objects. Read more about WebORB and Robotlegs integration.
  • Native Android Java code generator and invocation client - WebORB includes a tiny native Java library supporting remote procedure calls of the WebORB hosted services from native Android Java applications. Additionally, we also added a code generator which can create Java client-side code for any given WebORB service. The generated project also includes a visual invoker to make it easier to see the generated code in action.
  • Windows Phone invocation client (with code generator)- similar to the native Android Java library, we also added a native Windows Phone (Silverlight) client-side library into the WebORB distribution. Using the library Windows Phone applications can easily integrate with WebORB-hosted Java services using either RPC or publish/subscribe APIs. There is also a code generator which can create C# code and a sample Windows Phone project for any deployed Java service.
  • New Swiz code generator – We have completely rewritten the Swiz code generator to support the latest release of the Swiz framework. The generated code includes all the events, pre-wired controller, service invoker and value object types.
  • Code generator for rich media Flex, AIR and Mobile apps – WebORB for Java supports the RTMP protocol and enables video streaming and recording, remote shared objects and server-side data push. In this release we added a code generator which can create a sample Flex, AIR or  mobile application with the code demonstrating all of these features. Optionally, the code can be generated to support RTMP tunneling for any of the selected features. Read more..
  • Code generator for multi-client Publish Subscribe messaging – WebORB provides native libraries and APIs for publish/subscribe messaging for Flex, AIR, JavaScript, native Java and .NET clients. The unifying concept for all of these APIs is the messaging destination. With the new release, it is trivially easy to manage destinations and on top of this, developers can quickly generate native publish/subscribe messaging apps for all the supported client-side types.
  • Publish/Subscribe Messaging Test Drive – When you develop a messaging application, it may be very important to be able to observe message traffic over your destination. It is very easy to do that with the new release. Simply open the management console, Find your destination under the Messaging Server tab and click “Test Drive”. The feature lets you both create subscribers and publish test messages.

As you can see it is a feature packed release. We also fixed quite a few bugs and you can access a full report in the Midnight Coders bug tracking system. We plan to publish follow-on posts with videos and examples demonstrating all the new functionality in the coming days.

Enjoy!

Java Data Push to Native iOS, Android and Windows Phone applications

The example reviewed below demonstrates data push from a server-side Java application to three different native mobile app implementations: iOS, Android and Windows Phone. The server updates the data every 1.5 seconds and delivers it to the clients. The iOS client uses a persistent RTMP connection, the Android and Windows Phone clients use publish/subscribe messaging (via polling) to receive server-side updates. The source code for each mobile implementation and the server-side project (with deployment instructions) is available below the video:

Download source code:

Server-side Compilation and Deployment instructions:

  1. Download and install WebORB for Java (make sure to download version 4.3 or above) .The product is available for free with the Community Edition license. Without a license key, it will work in the “development mode” which will be sufficient to the this example. See WebORB Licensing for additional details.
  2. Download Java project files.
  3. To compile the Java project, add the following JAR dependencies: weborb.jar, red5.jar, spring-core-3.0.0.jar. All the required jar files can be found in [WEBORB-INSTALL-DIR]/webapp/WEB-INF/lib.
  4. The compiled classes can be deployed to [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes/examples/weborb (if the package structure changes, the directories under WEB-INF/classes will have to change as well).
  5. Register new messaging destinations. To do this, open [WEBORB-INSTALL-DIR]/webapp/WEB-INF/flex/messaging-config.xml in a text editor, add the following destination declaration before the closing </service> element, then save the file:
    <destination id="StockExchangeDestination">
      <properties>
       <server>
         <durable>false</durable>
       </server>
       <message-storage-policy>weborb.messaging.v3.MemoryStoragePolicy</message-storage-policy>
       <message-service-handler>weborb.messaging.v3.MessagingServiceHandler</message-service-handler>
      </properties>
      <channels>
        <channel ref="my-polling-amf"/>
      </channels>
    </destination>
    
  6. Register new RTMP messaging application: To do this create a new XML file with the following contents in  [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes. Name the file stockexchange-web.xml (alternatively, you can download the file from here):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
      <bean id="stockexchange.context" class="org.red5.server.Context" autowire="byType" />
      <bean id="stockexchange.scope" class="org.red5.server.WebScope" init-method="register">
        <property name="server" ref="red5.server" />
        <property name="parent" ref="global.scope" />
        <property name="context" ref="stockexchange.context" />
        <property name="handler" ref="stockexchange.handler" />
        <property name="contextPath" value="/StockExchange" />
        <property name="virtualHosts" value="*,localhost, localhost:1935, localhost:8080, 127.0.0.1:8080" />
      </bean>
      <bean id="stockexchange.handler" class="examples.weborb.AppAdapter" singleton="true" />
    </beans>
    
  7. Modify beanRefContect.xml from [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes by adding the following XML element before the closing </list> element.
    <value>stockexchange-web.xml</value>
    
  8. Run WebORB for Java in a command prompt/terminal window by using the following command (run the command from the WebORB installation directory):
    java -jar weborb.jar
  9. Verify that WebORB is running by opening the management console from: http://localhost:8080
  10. Compile and run the mobile applications. Use the following configuration parameters:
    iOS – Hostname: if launching in iOS Simulator, use localhost, otherwise enter IP address of the machine where weborb is running. Application name: StockExchange, port – 1935
    Android and Windows Phone- WebORB URL – http://localhost:8080/weborb.wo (if running on a device, substitute localhost  with the IP address of the machine where WebORB is running).

Enjoy!

Integrating Native Android with .NET via Publish/Subscribe API

A few days ago we published an example demonstrating .NET data push to a native iPhone application. In that example the backend service was a .NET application hosted in WebORB for .NET. The application used WebORB as an RTMP server to deliver real-time updates to the client devices. In addition to the RTMP clients (like an iOS devices or Flex apps), a slightly modified version of the same code can easily support clients connecting via publish/subscribe API. An example of a such client can be a native Android application using our client-side library. We put together a native Android application and extended the server-side code to support publish/subscribe clients. The video below demonstrates the example in action and provides a brief code review. The instructions for setting up and running the example follow the video.

Follow the steps below to deploy and run the example:

  1. Download and install the latest version of WebORB for .NET. (This post assumes the product is installed in the default installation directory. For the version 4.4, the installation directory is: c:/Program Files/WebORB for .NET/4.4.0.0/)
  2. Download the client-side project from:
    http://examples.themidnightcoders.com/blog/StockExchangeAndroidClient.zip
  3. Download the server-side project from:
    http://examples.themidnightcoders.com/blog/StockExchangeWithPubSub-server.zip
  4. Open the server-side project in Visual Studio. Compile the project and make sure the compiled assembly is copied into the /bin folder in the WebORB installation directory (c:/Program Files/WebORB for .NET/4.4.0.0/bin)
  5. Open messaging-config.xml from c:/Program Files/WebORB for .NET/4.4.0.0/WEB-INF/flex in a text editor.
  6. Add the following XML block before the closing </service> tag:
      <destination id="StockExchangeDestination">
        <properties>
          <server>
            <durable>false</durable>
          </server>
          <message-service-handler>Weborb.Messaging.PubSub.Memory.MessagingServiceHandler</message-service-handler>
          <message-storage-policy>Weborb.Messaging.PubSub.Memory.MemoryStoragePolicy</message-storage-policy>
        </properties>
        <channels>
          <channel ref="my-polling-amf" />
        </channels>
      </destination>
    
  7. Create “StockExchange” directory under the “Applications” folder located at: c:/Program Files/WebORB for .NET/4.4.0.0/Applications)
  8. Create the app.config file in the StockExchange directory with the following contents:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <application-handler>StockExchange.AppHandler</application-handler>
    </configuration>
    
  9. Compile and run the Android project. Once the client application runs enter the WebORB remoting endpoint URL (for example for the local installation it may be http://localhost/weborb4/weborb.aspx). Click the ‘Connect’ button to establish a connection with the server-side application.

Developing Android Apps with WebORB

android and weborbThe idea of Universal Mobile Connectivity™ is quickly becoming a reality as we announce our support for Android integration. Before I delve into the details, let me jump onto my soapbox for a moment… ;)

WebORB is a powerful, client-agnostic technology enabling client/server integration at many different levels. The integration includes RPC (remote procedure calls) for a wide range of service models, publish-subscribe data messaging, video/audio recording and streaming, ultra-simple data management API/runtime and development productivity tools that actually work and help devs focus on what they do best. As the number of Android applications is growing, an army of developers are looking for ways to quickly and efficiently integrate phone-based applications with server-side technologies. For the most basic connectivity you can hear some people suggesting JSON (which we support, btw), some (even more old-school people) suggest SOAP web services or perhaps ancient-as-dinosaurs HTTP GET/POST type of integration. Will these approaches work? Sure, with enough persistence and a ton of billable hours, you can get anything to work. Will it cost a lot to develop? you bet! Will it scale? very unlikely. Will it be easy to maintain and evolve? I hardly doubt it. After all, it is 2011 and it is definitely time to realize that a well-done client/server integration is really in the heart of any successful application, whether it is an enterprise system or a silly game for a mobile device. Welcome to the 21st century, it is time to get serious about integration :) [Jumping off the soapbox]

Whether you are a Java developer or you build apps using Flex/AIR or Android, the topic of client-server integration is not very-well defined or prescribed. However, WebORB as a client/server integration server provides a very powerful solution for connecting Android apps (both Java and AIR) with Java, .NET and PHP backends. Android Java apps can use the APIs for RPC (remote procedure calls) and publish/subscribe messaging. The AIR clients can easily tap into WebORB hosted services, messaging destinations, media streams and data management using the standard APIs available in the Flex/AIR SDKs, including the RTMP integration.

The best way to get an idea of the capabilities WebORB provides for Android is to watch the videos linked below. It is a recording of a webinar we conducted a few weeks ago on the subject of Android and WebORB integration. Additionally, the documentation can be found at: Android and WebORB integration documentation.

Happy WebORB-ing on Android!

Java Object Access in Google App Engine from Flex/Flash, Silverlight, JavaScript and Android

One of the new features in WebORB for Java v.4.1 is support for Google App Engine integration. With the integration any Java class or Spring bean deployed into a Google App Engine application can be accessed by all the client types supported by WebORB. The list of the supported clients includes: Flex/Flash, Silverlight, JavaScript/AJAX, Android, Windows Phone and in the very near future iOS clients. The clients can invoke methods on the deployed Java services and exchange data using primitive and complex types, arrays, collections, etc. By using WebORB as the client/server integration tier, your application will greatly benefit from the superior performance enabled by the product as well as significantly streamlined application development process.

To learn more about WebORB for Google App Engine, see the WebORB Documentation and/or watch the video below: