Reusable Java and WCF Service Test Clients
I needed a reusable method to recursively test a WCF service host I had written from both the Java and .NET worlds. I wanted to be able to submit the test harness with service WSDL and pass in test parameters.
Being familiar with Microsoft technology, I knew exactly where I could find a reusable WCF client test harness (located at %installDir%:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WCFTestClient.exe). However when it came to locating a reusable test client in the Java world, I was stumped. A colleague at work directed me to download Eclipse for Java development but I easily ended up spending a few evenings learning to use the GUI and Java language specifics. Time pressures outside my work schedule did not allow me to code from scratch a generic Java test harness for the future.
By chance, I happened to stumble on Eclipse’s Web Services Explorer :). The Web Services Explorer was exactly what I was after!!!
It was now possible for me to seamlessly test services built from both Java and .NET environments without having to write a single line of code. The below screenshots display both the Eclipse Java EE Web Services Explorer tool and Microsoft’s WCF Test Client tool.
User Impersonation in WCF
In some integration scenarios, impersonation is required, where a WCF service is required to assume the caller’s identity. Though this usually happens for a single call, the impersonation token could be retained for future use by the WCF servce. The reason impersonation is most relevant to integration scenarios is because all WCF service code running under the priviledges of the caller ensures that only resources and data available to the caller are made available.
I found this to be partcularly useful while integrating middle layers of various heterogeneous systems. I did not have to add additional integration code to ensure that application-level authorization was being implemented because I could be assured that the impersonated thread would be denied access if relevant permissions to resources have not been authorized in the target system.
Inline code to support impersonation in WCF is as shown below:
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public int AddNumbers(int i, int j)
{
return (i + j);
}
To implement impersonation on all Operations, a behavior could be configured as shown below:
<behaviors>
<serviceBehaviors>
<behavior name=“ServiceBehavior“>
<serviceAuthorization principalPermissionMode=“UseWindowsGroups“
impersonateCallerForAllOperations=“true“>
</serviceAuthorization>
</behavior>
</serviceBehaviors>
</behaviors>
Summary of default WCF Bindings
A binding in WCF is one of the most important concepts behind the WCF architecture itself. Developers can create their own bindings if the below default WCF bindings do not suit a purpose by extending CustomBinding.
First a definition of what a binding controls. A WCF binding controls the following:
- Transport (HTTP, MSMQ, Named Pipes, TCP)
- Channel (one-way, duplex, request-reply)
- Encoding (XML, binary, MTOM, JSON)
- Supported WS-* protocols
I found the below matrix extremely helpful when determining which implementation of default binding to use when determining a solution architecture.
| Binding | Configuration | Security | Default Session |
Transactions | Duplex |
| basicHttpBinding | Basic Profile 1.1 | None | No | - | - |
| wsHttpBinding | WS | Message | Optional | Yes | - |
| wsDualHttpBinding | WS | Message | Yes | Yes | Yes |
| wsFederationHttpBinding | WS-Federation | Message | Yes | Yes | No |
| netTcpBinding | .NET | Transport | Optional | Yes | Yes |
| netNamedPipeBinding | .NET | Transport | Yes | Yes | Yes |
| netMsmqBinding | .NET | Transport | Yes | Yes | No |
| netPeerTcpBinding | Peer | Transport | - | - | Yes |
| msmqIntegrationBinding | MSMQ | Transport | Yes | Yes | - |
The above information has been condensed from Microsoft MSDN for ease of reference.
Deep Zoom Technology – Microsoft and Adobe
I was absolutely blown away with a demonstration of Vertigo’s work on SilverLight Deep Zoom at Microsoft TechEd 2008. Vertigo won the Microsoft Partner of the Year award for Web Development for 2008. Their work on the Hard Rock Memorabilia website is testament to their awesome creativity and the clever use of the SilverLight Deep Zoom technology.
Even the Barack Obama campaign is using Deep Zoom technology in the most creative of ways.
Adobe’s Flash evangelist Lee Brimelow was quick to point out that the Deep Zoom feature was not a new concept in Flash. Zoomarama takes Deep Zoom one step further with allowing you to create free, personal albums leveraging Adobe’s technology.
I cannot wait to get started with leveraging Deep Zoom at work. There are almost half a dozen web-based projects I can think of where I could have leveraged this technology to wow our customers.
Iterating through SharePoint 2007 Site Collection entities
I found that a simple yet good introduction to the SharePoint 2007 SDK was by playing with the iterative code below that lists nested sites and nested lists within a site collection. A colleague of mine who has just started looking at the SharePoint 2007 object model found this a good quickstart because the code gave him an avenue to start stepping in to the various SharePoint SDK objects and looking at their members. I hope you could find some use for it too.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
namespace TestSP
{
class Program
{
static void Main(string[] args)
{
using (SPSite siteCollection = new SPSite(“http://test:41606″))
{
foreach (SPWeb site in siteCollection.AllWebs)
{
foreach (SPList currentList in site.Lists)
{
SPQuery query = new SPQuery();
SPListItemCollection items = currentList.GetItems(query);
foreach (SPListItem item in items)
{
Console.WriteLine(“Item from site ‘{0}’ and list ‘{1}’ is named ‘{2}’”,
site.Title,
currentList.Title,
item.Name);
}
}
}
}
Console.ReadLine();
}
}
}
Output
Installing PerformancePoint Server 2007 on a domain controller VPC
Last month I was attempting to install PerformancePoint Server Planning and Monitoring 2007 on a development virtual machine that I had promoted to a Domain Controller and the pre-requisite check kept failing with the below ambiguous message ”Failed Windows Server 2003 SP1 (non domain-controller)”. My OS was Windows Server 2003 SP2 and I just could not make sense of what was happening. As a consequence of failing this pre-requisite check, the ”Next” button was grayed out and I was stuck.
The easiest way to hack this pre-requisite check was by running the relevant MSI’s from command prompt with the SKIPREQCHECK argument set to true.
PerformancePoint Planning Server 2007
D:\> MSIEXEC /i PPLSrv.msi SKIPREQCHECK=1
PerformancePoint Monitoring Server 2007
D:\> MSIEXEC /i PSCSrv.msi SKIPREQCHECK=1
Launching the MSI this way ensures that the “Next” button is highlighted. I experienced no further issues with the setup on the VPC. Though Microsoft do not recommend installing the product on a Domain Controller, I needed to do it this way so I had a single, consolidated development VPC.
Master Data Management Initiative at Microsoft
Metadata consolidation across the enterprise is a challenge that most larger corporations face. After working in the ECM and EDRMS industries for a while, I am very excited at Microsoft’s Master Data Management (MDM) initiative and the value that an integrated offering would bring to a Solution Architect’s toolset and enterprise strategy.
Read up on Microsoft’s MDM roadmap and Project Bulldog currently in CTP at http://download.microsoft.com/download/4/6/2/462b1624-2ac4-4ebd-b4c0-7eaef3e4466d/MSMDMRoadmap.pdf.
As I work for a key Microsoft Australian partner who will be trialling the CTP product in Q3 2008, do contact me if you are interested in more information.
Copy MS Word tables to MS Excel
When you copy table data from MS Word to MS Excel, line breaks in MS Word tables are replaced with new cells in MS Excel.
This can be quite annoying when you are copying and pasting large tables. A work-around is described below:
In the MS Word Table
- Replace the string ”^p” with “#”.
- Replace the string ”^l” with “#”.
- After the above transformations are implemented, copy the MS Word table.
In MS Excel
- Paste the copied MS Word table in MS Excel.
- Replace the string “#” with [Ctrl + j], noting that [Ctrl + j] is actually a keyboard combination rather than plain text.
Demystifying SilverLight (Updated)
Microsoft have released and renamed versions of SilverLight thereby causing some confusion. The below release timeline may help,
-
SilverLight 1.0.20816 RTW (Release-to-Web): 05-Sep-2007
-
SilverLight 1.1.20926.0 Alpha Refresh (re-christened SilverLight 2.0): 05-Sep-2007
-
SilverLight 1.0.21115.0 Service Release: 20-Nov-2007
-
SilverLight 2.0 RTM is scheduled to be released at the end of 2008
I also hope the following perspectives help with understanding where the technology currently stands, what is envisaged and what licensing restrictions (if any) exist.
SilverLight 1.0 – Brief Architectural Perspective:
-
A SilverLight 1.0 app invokes an embedded SilverLight control in a HTML web page that in turn locates and invokes a XAML file that contains the all-important Canvas object.
-
All other entities in a SilverLight app are hosted within the Canvas object.
-
Each of these entities may have custom events associated to them.
-
The event handlers are implemented by developers who can invoke the Canvas object DOM via JavaScript only.
-
Data models are based on JSON and XML.
SilverLight 1.0 – Licensing Restrictions: Free install as a plug-in for the browser. Browsers include IE 6 SP2, IE 7, FireFox and Safari. There is currently no support for Opera or Konqueror.
SilverLight 2.0 – Brief Architectural Perspective:
-
Following Microsoft’s strategy for implementing WPF/E (Windows Presentation Foundation Everywhere), SilverLight 2.0 is powered by atleast one running instance of a CoreCLR in a browser process, noting that there can be many more.
-
The CoreCLR is basically a mini .NET Framework that is so portable, that it can be run in the browser. This makes the architecture more consistent and a developer’s life easier as s/he can now write code in VB.NET or C#. The inclusion of the LINQ API implies seamless ORM and a robust data access API. It must be noted that currently there is no LINQ to XML support within SilverLight 1.1 Alpha Refresh.
-
Improving upon the scripting model in version 1.1, Microsoft have written managed wrappers for the Canvas object’s DOM access.
-
Data models can now be based upon RSS, POX, JSON and XML.
-
The SilverLight 2.0 Architectural Stack is as shown below:
SilverLight 2.0 – Licensing Restrictions:
-
SilverLight 1.1 was re-christened to SilverLight 2.0 in late November 2007.
-
SilverLight 2.0 is to be distributed as a free browser plug-in.
-
Microsoft is to announce the SilverLight 2.0 Beta release during MIX ’08 in early March 2008.
-
SilverLight 2.0 Beta 1 released on 05-Mar-2008.
-
SilverLight 2.0 Beta 2 is scheduled to be released during the 2nd quarter of 2008.
-
SilverLight 2.0 RTM is scheduled to be released at the end of 2008.
-
Visual Studio 2008 requires a license for development.
-
Visual Studio Tools for SilverLight is an empowering Visual Studio 2008 add-in that is currently (as of this writing) in Beta 1. Click here to download.
SQL Server 2008 – Will new features be leveraged in TRIM Context and SharePoint?
With the upcoming release of SQL Server 2008 (aka; Katmai) during the 3rd quarter of 2008, Microsoft seem to be working hard on delivering some cool functionality with the new database management system. With reference to some of the information management products that I work with; namely TRIM Context and SharePoint, I see vast potential for improvement in these products while leveraging new SQL Server 2008 features.
A couple of new features that really excite me with respect to TRIM and SharePoint are:
- The addition of the FILESTREAM data type in Katmai that will contain both structured and semi-structured data. This means that structured meta-data about the file is stored in the database itself, while the semi-structured BLOB data resides on the NTFS file system. With SharePoint 2007, I never really understood why Microsoft elected to place files in a relational database rather than on an NTFS volume (built in the very first place to optimise streaming). Anyway, the point is that when the database is backed up, referenced files on the NTFS volume are backed up as well. T-SQL and Win32 API’s can now be used to access files seamlessly. I would think that Microsoft would be keen to leverage this feature in SharePoint 2009.
- TRIM Record Locations are a reference to a physical or abstract existence of a body of information. Therefore a record location in TRIM could point to a person who owns the body of information or a shelf location where the body of information resides (eg; a book in a library). With the introduction of new spatial data types GEOMETRY AND GEOGRAPHY in Katmai, planar (flat-earth) and ellipsoidal (round-earth) data can be represented in SQL Server 2008 seamlessly. It would be a pity not to see Tower Software and HP ignoring to extend the Record Location TRIM concept to use the new spatial data types as this would be extremely applicable to the records world and several key industry verticals including State and Federal Department, Asset Tracking and Asset Management and auto-allocation.
- The Change Data Capture feature being introduced in Katmai could be leveraged extensively within both TRIM and SharePoint.The Change Data Capture feature provides the ability to capture what has changed in a database structure as a steady stream. While this push-model could not only provide OLTP -> OLAP integration for both products, current capabilities of the products with respect to retention and auditing could be vastly improved.





