|
|
|
|
|
|
Have you ever come across situations in your projects where you would have needed a composite transport for WCF? WIth a composite transport I mean the ability to have transport X for inbound messages and transport Y for inbound messages. Ideally you should be able to use one-way, request-reply and duplex messaging with this composite channel (and binding).
Kenny hinted at some possible way to do this - I just want to know from you whether you would really need such a channel/binding! Just drop me a line - thanks.
|
|
|
I have been asked this question many times and thought I just put a quick note here. If you want to access the message from a WCF service operations then you need to distinguish two cases.
Strongly-typed contracts
public string Hello(string hello) { Console.WriteLine(OperationContext.Current.RequestContext.RequestMessage.ToString()); return hello; }
Universal contracts
public void Process(Message message) { Console.WriteLine(message.ToString()); }
But calling ToString() on the message itself will only print <stream>…</stream> if it is a streamed message. In these cases you may need to do something similar like the following snippet in order to print the body of the streamed message.
XmlTextWriter xtw= new XmlTextWriter(Console.Out); xtw.Formatting = Formatting.Indented; message.WriteMessage(xtw); writer.Flush(); writer.Close();
|
|
|
About time! Until now I have been using solutions like memcached and was quite comfortable with it. Now the big house itself offers the first CTP of a distrbuted cache engine code-named Velocity. This is surely high on my list as in the past years - if nothing else - we have learned that caching is one of the most important factors for effective distributed applications.
I can already see our WCF-based apps running with Velocity. Let's try it. And see whether it is worth to dump memcached.
|
|
|
No, not these kinds of domain-specific languages (DSL)... I must admit, the following code has a not too small degree of sexiness. The DSL-iness is not just for WCF but for a number of mainly dependency-injection-related scenarios, but obviously I tend to care more about WCF :)
Service side:
var windsorContainer = new WindsorContainer() .AddFacility<WcfFacility>() .Register( Component.For<LoggingInterceptor>(), Component.For<IMyContract>().ImplementedBy<MyService>() .ActAs(new DefaultServiceModel().AddEndpoints( WcfEndpoint .BoundTo(new NetTcpBinding()) .At("net.tcp://localhost/MyService/internal") ) ) );
Consumer side:
var windsorContainer = new WindsorContainer() .AddFacility<WcfFacility>() .Register(WcfClient.ForChannels( new DefaultClientModel() { Endpoint = WcfEndpoint.ForContract<IMyContract>() .BoundTo(new NetTcpBinding()) .At("net.tcp://localhost/MyService/internal") }) ) ); I am currently investigating a bit into Windsor Castle and its WCF facility. What I see until now I like, but I am just at the beginning. There is a lot more in Windsor's WCF support which is worth digging into - all in all these features are aimed to make using WCF a bit more natural and a bit more straight-forward.
Some feature points from the latest release:
*Client Side:
- Automatic generation of WCF client channels when a component has been configured for WCF Client capabilities.
- Any Endpoint or Operation behaviors registered in the kernel will be attached to the channels.
- Automatic cleanup of channel proxy when component is released (channel.Close() vs channel.Abort), i.e. no need to cast proxy to IChannel and call Dispose.
- Automatic detection of unhanded channel faults and re-acquisition of new channel proxy. You can continue to use client proxy even after an exception occurs (by default WCF makes all faulted channels unavailable).
- Ability to use the client channel configuration from app.config/web.config
- Custom registration provider to simplify batch registration of channels
- Client extensibility interface IClientChannelBuilder. Supports plugging in other ways to create channels (e.g. REST-ful services)
*Service Side:
- Automatic management of ServiceHost when a component is configured for WCF Service capabilities.
- Any Service, Endpoint or Operation behaviors registered in the kernel will be attached to the channels.
- Ability to use the service channel configuration from app.config/web.config
- Service extensibility interface IServiceHostBuilder. Support for plugging in other ways to create ServiceHosts.
More to investigate...
|
|
|
Update: Steve and Omri have the official voices :)
In addition what Scott has in its extensive article on SP1, lemme show you some more data on what is new and supported for WCF in SP1 of .NET 3.5 and Visual Studio 2008 - this list is not authoritative, it is my list and not Microsoft's official one.
- DataContractSerializer can now serialize types without the need to annotate them with [DataContract] & DataContract-related attributes, aka POCO support
- Better support for object references in DataContractSerializer
- Support for interoperable object references in DataContractSerializer
- Support for fault detail serialization by XmlSerializer
- Event Logging is now enabled in partial trust
- Syndication object model supports the ServiceDocument in Atom Publishing Protocol (APP)
- URI templates & URI template table extended to better support ASP.NET MVC
- Hosting Wizard for Visual Studio WCF Service projects in IIS
- Expanded support in WCF Test Client
- Support for RM Sessions
- Support MessageContract + XmlSerializer
- Support Nullable<T> types
- Support to run stand-alone
- WCF Service Application template enabled in Visual Web Developer Express
|
|
|
Geballtes Know-How - für Sie!
thinktecture und DevelopMentor kündigen im Rahmen einer Partnerschaft das erste in Deutschland stattfindende "Enterprise .NET"-Event an. Es wird in der Woche vom 26. Mai 2008 in München stattfinden und im berühmt-berüchtigten "Guerilla"-Format abgehalten: Über 50 Stunden in 5 Tagen! Dominick Baier, Ingo Rammer und ich würden uns freuen, Ihnen alles Neue und Wichtige rund um verteilte Anwendungen auf Basis von .NET bei- und nahe zu bringen.
Lernen Sie, robuste verteilte Lösungen auf Basis der Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), Windows CardSpace und Biztalk Server zu entwerfen und zu implementieren. Der „Guerilla Enterprise .NET“-Kurs zeigt Ihnen, wie man diese Technologien und Produkte anwendet und verteilte Systeme damit erstellt. Dabei wird auf den jeweiligen Stärken der Technologien aufgebaut und versucht, die Schwächen zu umgehen – alles im Sinne Service-orientierter Prinzipien.
Erhalten Sie Antworten auf diese und weitere Fragen
- Was bedeutet Service-Orientierung wirklich?
- Wie erstelle ich interoperable Services?
- Wie kann ich einzelne „Building Block“ Services komponieren?
- Wie funktionieren Sessions und wann sollte ich sie nutzen?
- Wie kann ich lang andauernde Geschäftsvorfälle modellieren und ausführen?
Lernen Sie, skalierbare und flexible Service-basierte Anwendungen mit den aktuellen Technologien aus dem .NET Framework 3.5 zu bauen.
Highlights des Kurses
- Verstehen Sie die Architektur von WCF, WF und Biztalk Server
- Schreiben Sie Services für Internet- und Intranet-Szenarios
- Erstellen Sie robuste lang laufende Workflows
- Verstehen Sie die Unterschiede und jeweiligen Stärken von Biztalk Server und WF
- Erstellen Sie asynchrone nachrichtenbasierte Anwendungen
- Integrieren Sie Services und Workflows mit WCF und WF
Wir würden uns freuen, Sie ab 26. Mai 2008 in München begrüßen zu dürfen - "Take your enterprise .NET programming skills to the next level!" Registrierung und weitere Informationen können per Email an office@thinktecture.com abgewickelt werden.
[Flyer im PDF-Format]
Infos zum Guerilla-Format: Anders als bei "üblichen" Trainings werden Sie in den fünf Tagen ständig durch drei (3) Trainer betreut – Montag bis Donnerstag auch bis in den späten Abend hinein. Sie können Ihre Kenntnisse und Fähigkeiten bei Programmier-Challenges mit den anderen Teilnehmern messen und attraktive (und auf jeden Fall auch Geek-)Preise gewinnen.
|
|
|
thinktecture always had really great experts for a variety of technologies and areas of expertise in order to help software architects and developers with problems in their projects - but...
... we were always lacking some guy who knows how to do good user interface design and who knows literally everything about classical Windows programming, Windows Forms design and hacking and last but not least enjoys working with WPF and Silverlight. It was just very hard to find this super-hero - but...
... now he is here: Jörg Neumann (yeah, he promised to deliver a more reasonable text soon :)) His blog is currently only available in German but I am sure we can force him to switch language.
I am glad, we are all glad - I already had the pleasure to work with Jörg on some POC apps, his knowledge simply rocks. Oh well: Jörg is also quite a nice guy, although he is from Northern Germany - well...
P.S.: Jörg is also very knowledgable with everything SQL Server, e.g. he has written a book on this very topic (in German).
|
|
|
I had several people asking me for some details about what exactly is fixed in 3.0 SP1 - so here is some more information.
The .NET Framework 3.0 Service Pack 1 fixes the problems that are described in
the following articles in the Microsoft Knowledge Base:
932471 FIX: Error message
when you try to open or to create a protected XPS document by using the XPS
viewer that is included with the .NET Framework 3.0: "Cannot open this document
because your permissions have expired" 932816 FIX: You experience
various problems in Windows Workflow Foundation 935314 FIX: You may
experience issues with Windows Communication Foundation peer channel connections
935315 FIX: The COM+
application cannot start when you use the COM+ Service Model Configuration tool
to expose the COM+ components in the COM+ application 935434 FIX: Error message
in FIPS-compliant systems when you use Windows Communication Foundation to
serialize generic types: "This implementation is not part of the Windows
Platform FIPS validated cryptographic algorithms" 936123 FIX: Error message
when you open a workflow by using the workflow designer in Visual Studio 2005:
"Error loading workflow" 936512 FIX: A memory leak
occurs when you send many messages by using the NetMsmq transport in the .NET
Framework 3.0 938758 FIX: The Unload
method may stop responding (hang) in a Windows Workflow Foundation project
942520 FIX: You may
experience slow performance when you run a Windows Communication Foundation
application
|
|
|
Just to make this point very clear: ADO.NET Data Services (aka 'Astoria') is not tied to a database, not tied to relational data and surely not tied to the ADO.NET Entity Framework. *Data* in 'Data Service' doesn’t mean 'Database', but it literally just means 'Data' of any kind. I try to post sample over the coming weeks to prove this point.
|
|
|
Usually, I do not post just "+1"... but this time - and I have been fighting with myself not to rant too much about Volta - I am 100% with Rich. I just think there is too much "Oh, that is easy: just one attribute and a switch and I'm done"-mantra in there...
Well, keeps me busy :)
|
|
|
Quick note: Astoria services are PerCall by default. A data service derives from WebDataService<T> which looks like this:
[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] [AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)] public class WebDataService<T> : IRequestHandler, IWebDataService ...
|
|
|
You can access the SSDL (ADO.NET Entity Framework's store schema definition language, and *not* this one here) of your Astoria Data Service by appending $metadata to the base URL, like this:
http://localhost:7777/Services/Data/NW/$metadata
This metadata can e.g. be used to generate client-side code with the WebDataGen.exe tool, like this:
webdatagen /mode:ClientClassGeneration /uri:http://vmxpsp2:7777/Services/Data/NW /outobjectlayer:Northwind.cs
This creates entities which you can use to program against, for example by leveraging the Astoria client API.
|
|
|
The latest Astoria / ADO.NET Data Services CTP also includes a client-side library with support for creating LINQ queries against a REST API - very interesting. Details can be found here.
|
© 2002 - 2006 by thinktecture, Ingo Rammer and Christian Weyer. All rights reserved.

|
|