Christian Weyer: Smells like service spirit

What's first?

March 2005 - Posts

Today and tomorrow: Will Indigo heal...? I want, I want - no, I want my DataSet!

Despite all the SO(A)-iness out there we sometimes just want or simply need to ignore it.
One of those topics is the good old
DataSet. There is lot of trouble when you use it and you do not know all the problems and side effects it may cause. But in some certain scenarios, it might just be fine. Consider the following sample contract for an Indigo service.

[ServiceContract(Session = true)]
public interface IWantIt
{
  [OperationContract()]
  DataSet GetData(string ID);
}

A very common and often used pattern. Usually this should work just fine. ASMX does handle it quite well. But if we build an application which hosts an Indigo service that implements this contract we will get a runtime error – it builds fine, yes. Why?

Indigo is using the XmlFormatter class by default. XmlFormatter does not support non-data contract schema. And using a System.Data.DataSet type means breaking with the data contract rules. However there is support for non-data contract schema using good plain old XmlSerializer.

With the following updated ServiceContracteverything should work as expected.

[ServiceContract(Session = true, FormatMode = ContractFormatMode.XmlSerializer)]
public interface IWantIt
{
  [OperationContract()]
  DataSet GetData(string ID);
}

Again, this does not mean that you are supposed to use DataSets in your contract… J


Posted: Mar 19 2005, 05:48 AM by CWeyer | with 6 comment(s)
Filed under:
ASP.NET 1.1 does 2.0: free controls & more

Just stumbled across this incredible compilation of free tools, libraries and controls for ASP.NET 1.1. This really makes adopting a lot of ASP.NET 2.0’s features already with today’s platform.


Posted: Mar 18 2005, 09:04 PM by CWeyer | with 6 comment(s)
Filed under: ,
WSCF 0.5: quick note

As we are currently receiving numberless emails per day asking when we finally will release WSCF 0.5, I will just make an official statement here.

We plan to finish testing beginning of April (after my Florida trip) and hope to have WSCF 0.5 ready for release-to-web mid April. Thanks for your patience and support!

See you.

 

Posted: Mar 17 2005, 06:34 AM by CWeyer | with 2 comment(s)
Filed under:
Today and tomorrow: Will Indigo heal...? Secure (not only Web) Services

Indigo is not always just about 'Web' Services. Sometimes you really want to have a powerful but still modern means to e.g. secure your service app. In the former times you just had to use DCOM for securing your program's communication based on Windows security (without having to revert to ASMX/IIS).

So let's take a look at some sample scenario. We like to be able to configure Windows-based authorization in Indigo for a self-hosted service. We simply want to restrict access to a certain list of users/groups in our domain.

Indigo supports PrincipalPermission and PrincipalPermissionAttribute. So with this, we can decorate our operation like this:

  [PrincipalPermission(SecurityAction.Demand, Name="THINKTECTURE\cweyer")]
  public string DoItBabe(string action)

Adding to this, we can obviously also handle groups through a roles parameter:

  [PrincipalPermission(SecurityAction.Demand, Role="PowerUser")]
  public string DoItBabe(string action)

And yes, we can combine multiple attributes and settings:

  [PrincipalPermission(SecurityAction.Demand, Name=@"THINKTECTURE\cweyer")]
  [PrincipalPermission(SecurityAction.Demand, Role="PowerUser")]
  public string DoItBabe(string action)

Please note that the above code says that either “PowerUsers” or “THINKTECTURE\cweyer” can access the method.

Update: Just saw that Adi also has a similar post J


Posted: Mar 16 2005, 11:25 AM by CWeyer | with 1 comment(s)
Filed under:
WinFX March CTP is here - including early Indigo bits

Get it at MSDN Subscriber’s Download. And mind that the Indigo bits are very early and rough…

 Platforms
   -Windows Longhorn Client Preview
     -WinFX SDK - Community Technology Preview
       -Avalon and Indigo Community Technology Preview - March 05 (English)

The SDK should be available to the public in a few days.


Posted: Mar 16 2005, 10:09 AM by CWeyer | with 2 comment(s)
Filed under:
Indigo to go: CTP build ahead, docs available

I can swear you: we have been damn busy (and actually still are…) due to this cool technology. In the meantime – until the CTP bits for Avalon and Indigo are available – check out the docs!


Posted: Mar 16 2005, 12:48 AM by CWeyer | with 7 comment(s)
Filed under:
Today and tomorrow: Will Indigo heal...? Indigo, oh well - what about COM+?

OK, sorry. No code this time, but quite useful information, I think.

Rick Strahl asks about the relationship between COM, COM+ and Indigo,

First: no, Indigo does not communicate on the wire using DCOM.
But Microsoft provides the ability to expose (even existing) COM+ services as Indigo services without requiring any code change in the COM(+) implementation on the server side. You just need to run a tool and a corresponding 'invisible' Indigo service is built for you. This service exposes the COM+ component to the wire, as an Indigo style web service.

But there is still the 'other direction'. What about COM(+) calling Indigo services? For this, we may use the special Indigo moniker to enable COM developers (like VB6, VBA etc. geeks) to communicate with the Indigo services in a COM-like but Indigo-natural manner.
So let's go a bit into detail.

COM+ application as an Indigo service

It is a tool thing. Using Indigo’s COM+ integration feature, a developer is able to do this without making any code changes. Just run the Indigo integration utility on the appropriate application interfaces. When the COM+ application is restarted, the appropriate Indigo service will be started and there will be a rich functioning Web service interface to the existing business logic - which of course does not mean that one should expose *any* COM application via an ‘automatic Web services interface’… just like the checkbox feature in COM+ to enable ‘SOAP functionality’ (which uses .NET Remoting in fact).

With this feature developers are able to specify the binding, transport and address choices, determining where and how the service will be offered - all just through manipulation of a standard Indigo configuration file. No new code. Where the COM components within the application support or require transactions, the Indigo service will convey that requirement and support it on incoming request messages. Where the components within the application require authentication and authorization (i.e. Windows identity and thus COM+ roles), the Indigo service will convey that (authentication) requirement and enforce it (the authorization) on incoming request messages.

The behavior of the services fronting the COM+ application are provided by an automatically started Indigo listener and controlled by a standard Indigo configuration file.

By default, the service will mimic the RPC-like behavior of DCOM with reliable request-reply sessions using Indigo’s shared session instancing. The default binding, transport and address details come from a generated (at COM+ application/interface opt-in time) config file. Also, to mimic a secure DCOM deployment Windows authentication and encryption will be required by default. Different behaviors are only a config edit away.

COM client calling Indigo services

With the deployment of Indigo/Web services within their organization, both built on Indigo or other technology stacks (like IBM WebSphere, BEA WebLogic, or Axis), developers will be faced with difficult choices and significant challenges when deciding how to bring this newly developed functionality into the widely deployed COM based environments such as Office/Excel, ASP, VB6 or script. Using the Indigo service moniker, a simple approach to integration is provided. The execution of the moniker builds upon a local definition of the Web service interface – there are a few ways top to get this but one of the easiest is for developers to point the Indigo svcutil.exe tool at the URL of the service's metadata exchange endpoint (/MEX). This creates a client proxy and service interface details.
After ensuring that the type library from that assembly is marked
ComVisibleand referencing it from a development environment e.g. VB project, we are able to use the service moniker with the GetObject function to construct a proxy instance for that service within our 'legacy' code.
Just like this (OK, a bit of ‘old’ code, at least):

Dim MathProxy As IMathService
Dim result As Integer

Set MathProxy = GetObject( _
  "service:address=http://localhost/MathService, _
  binding= wsProfileBinding, _
  bindingName=Binding1")

result = AddService.Add(3, 5)

The COM Service Moniker takes most of its wire functionality directly from the standard Indigo client infrastructure and its binding configuration from a simple config file. Additionally, rather than simply picking up the current identity, the new IChannelCredentialsinterface on the proxy instance supports specifying credentials using a range of broadly interoperable mechanisms e.g. username/password or X509 certificates from a file or store.
Also, subject to configuration, when operating within a transaction scope, the transaction will flow using standard Indigo ServiceModel transaction mechanisms with the use of WS-AT on the wire where appropriate.

A big thanks goes to Microsoft's Andy Milligan for helping me putting together this information.

OK, and now off to the CeBIT computer show for the whole next week – then Florida J.


Posted: Mar 08 2005, 08:01 PM by CWeyer | with 2 comment(s)
Filed under:
TechTalk: Web services, sechs Jahre später: Missverständins oder Heilsbringer?

Im April (und ein bisschen vom Mai) werde ich durch die deutschen Lande reisen, um mich mit hoffentlich vielen interessierten Besuchern meines Microsoft TechTalks über das „Wunderkind“ Web services zu unterhalten.

Knapp sechs Jahre nach der ersten öffentlichen Spezifikation von SOAP ist es Zeit für ein Resumee. Lassen Sie uns in diesem TechTalk die Web services-Technologie Revue passieren. Sind Web services gescheitert? Oder einfach "nur" missverstanden worden? Was bringen Sie uns und wann lässt man lieber die Finger davon?

Ein Streifzug durch die Web services-Welt soll vorhandene Unklarheiten und Unsicherheiten aus dem Weg räumen. Vor allem die verschiedenen Web Services-Implementierungen aus der jüngeren Microsoft-Historie und der nahen Zukunft - und ihr Bezug zu anderen Technologien, verteilte Anwendungen zu erstellen - dienen als nahezu perfekter roter Faden für eine Geschichte, die einfach mal erzählt werden muss.

Erleben Sie einen Abend mit einer Fülle von harten technischen Fakten und Demonstrationen, gepaart mit philosophischen Gedanken. Sie werden sich vielleicht wundern, dass die bisher in der Breite vermittelte Sicht auf Web services nur einen sehr kleinen Prozentsatz dieser mächtigen Technologie ausschöpft. Lassen Sie uns gemeinsam den Rest des Potentials entdecken und ergründen. Denn ist nicht vieles am Ende ganz anders als wir zunächst vermuten? Sind spitze Klammern wirklich das Zentrum unserer Welt?

Es gilt den gesamten Abend über die Maxime "Was Sie schon immer über Web services und verteilte Anwendungen wissen wollten - aber nie zu fragen wagten". Fragen Sie den Referenten Löcher in den Bauch. Genau dafür ist er vor Ort bei Ihnen, um sein Wissen und seine praktischen Erfahrungen an Sie weiter zu geben.

Anmeldung zum TechTalk

Ich freue mich auf Sie!


More Posts