Thursday, February 28, 2013

Using .NET Assemblies with PowerBuilder

The archive of my PowerBuilder.TV webcast on Using .Net Assemblies with PowerBuilder is available.  This webcast demonstrates:

  • How to use non-visual assemblies in PowerBuilder Classic Win32 targets (any version) using COM Callable Wrappers (CCWs)
  • How to use visual assemblies in PowerBuilder Classic Win32 targets (any version) with assistance from theMicrosoft Interop Forms Toolkit
  • How to use non-visual assemblies in PowerBuilder Classic WinForm and WebForm targets using conditional code blocks
  • How to use non-visual assemblies from PowerBuilder.NET

Note that a PowerBuilder.TV account (which is free of charge) is required to access the webcast.  It was a repeat of the session I gave at the PowerBuilder Developer Conference that was co-hosted with SAP TechEd 2012.  The sample code used as well as the PowerPoint slides are available on my Google Drive.

Creation and Consumption of Web Services with PowerBuilder

The archive of the first of two of my PowerBuilder.TV webcast on the Creation and Consumption of Web Services with PowerBuilder is available.  The webcast examines some of the recent improvements in PowerBuilder 12.5 for the creation and consumption of web services, with emphasis on:

  • The new WCF client in PowerBuilder.Net
  • The new WCF service type in Powerbuilder.Net
  • The new REST client in Powerbuilder.Net

Note that a PowerBuilder.TV account (which is free of charge) is required to access the webcast.  It was a repeat of the session I gave at the PowerBuilder Developer Conference that was co-hosted with SAP TechEd 2012.  The sample code used as well as the PowerPoint slides are available on my Google Drive

The second webcast focused on providing WCF capability in PowerBuilder Classic by wrapping the WCF Client created in PowerBuilder.Net in a .Net assembly created in PowerBuilder.Net and then accessing that through a COM Callable Wrapper (CCW).  A link to that archive of that presentation will be provided as soon as it is available.

Saturday, February 23, 2013

Using PowerBuilder.Net Visual Components in WPF Browser Applications

In an earlier blog post I demonstrated how you can create visual components in PowerBuilder.Net and then use them from within Visual Studio (including the Express version that you can download free of charge from Microsoft).  What I created in Visual Studio for that demonstration was a WPF application, but there are other things you can do with PowerBuilder.Net visual components when you get them into Visual Studio.  One of those is to create a WPF Browser Application.

WPF Browser Application (also called 'XBAP', short for XAML Browser Application) is a method of running WPF applications within a browser and still maintain rich client functionality.  Think of it as the half way point betweenClickOnce (in which the application is simply distributed through the browser, but runs independently on the local machine) and SilverLight (where the application runs within the browser).  An XBAP application runs 'within' the browser to the extent that it uses it as the host that it displays in, so it appears to be a web application.  Like ClickOnce, it requires that the .Net Framework is was written referencing be deployed on the client, and will prompt the user to install it if it is not available.

In order to run XBAPs within Internet Explorer you must first customize one of the security settings to enable them.  The plugin that allows XBAPs to run within Firefox is distributed with .Net Framework 3.5.  Once it is installed, adding the location to it to the system path then enables Chrome and Opera to run XBAPs as well.  This site provides extensive details on getting the various browsers configured correctly.

XBAPs normally operate under partial trust.  However, depending on what your application needs to do you may need to elevate it's permissions to allow it to operate under full trust.  This site provides detains on enabling an XBAP to run under full trust.  For the sample app I used in that demo I needed to configure the XBAP to run under full trust because I wanted to do a binding redirect on the Oracle ODP.Net libraries and a binding redirect requires full trust.

Note that you will need to use PowerBuilder 12.5.1 (the maintenance release, not the original 12.5 release) in order to create the visual component.  One of the significant enhancements in that maintenance release was support forcompiling applications and components to support x64 and AnyCPU targets.  Assemblies created for use in XBAP applications have to target AnyCPU.

Having said all that, here's what the sample component looks like when compiled as an XBAP and then accessed via Internet Explorer:

internet_explorer.png

Here's the same XBAP being accessed from Firefox:

firefox.png
From Chrome:

chrome.png
And finally from Opera:

opera.png

Friday, February 01, 2013

Interfacing with the Google Data API from PowerBuilder.Net

Recently somebody asked me for help getting PowerBuilder.Net (and eventually PowerBuilder Classic through a COM Callable Wrapper) to interface with Google Calendar.  That actually turned out to be fairly simple because Google provides a .Net library for Google Data API which provides access not only to Google Calendar, but to a number of other Google services as well, such as Blogger, Contacts, Picasa Web Albums, Spreadsheets and YouTube.

We're going to see just how easy by accessing Google Calendar and retrieving our events for the next few days.  To do that, first download and install the Google Data API .net libraries (you only need the first one on the list).  Then create a PowerBuilder.Net WPF project and add references to the Google.GData.AccessControl, Google.GData.Calendar, Google.GData.Client and Google.GData.Extensions assemblies.