background preloader


Facebook Twitter

Dan Rigsby » Don’t Wrap Wcf Service Hosts or Clients in a Using Statement. Ok, this article is going to go against everything your mother taught you about cleanly disposing of your objects.

Dan Rigsby » Don’t Wrap Wcf Service Hosts or Clients in a Using Statement

Didn’t she always say, “Always dispose of your resources when you are finished with them. And scope it with a using statement if you can!”? My mother practically beat that into me growing up and she would probably disown me if she read this post. So at first glace I would think that this is how I might create a service and client in Wcf: using (ServiceHost serviceHost = new ServiceHost( typeof (MyService), new Uri( " ))) { serviceHost.Open(); } using (ChannelFactory<IMyService> channelFactory = new ChannelFactory<IMyService>()) { channelFactory.Open(); }

XML and ADO.NET Types in Data Contracts. The XmlElement type is serialized using its XML contents.

XML and ADO.NET Types in Data Contracts

For example, using the following type. [DataContract(Namespace=@" public class MyDataContract { [DataMember] public XmlElement myDataMember; public void TestClass() { XmlDocument xd = new XmlDocument(); myDataMember = xd.CreateElement("myElement"); myDataMember.InnerText = "myContents"; myDataMember.SetAttribute ("myAttribute","myValue"); } } Windows Communication Foundation Tools. WCF Troubleshooting Quickstart. The full error message is: HTTP Error 404.3 – Not FoundThe page you are requesting cannot be served because of the extension configuration.

WCF Troubleshooting Quickstart

If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Detailed Error InformationModule StaticFileModule. This error message occurs when “Windows Communication Foundation HTTP Activation” is not explicitly set in the Control Panel. Depending upon the exception, there may be several issues: It is highly recommended that you create your own custom error data type and declare that as the detail type in your fault contract. This commonly occurs after changing the user account under which the IIS worker process runs. WCF: Instance Management Techniques For Developing WCF Apps. WCF Essentials Discover Mighty Instance Management Techniques For Developing WCF Apps Juval Lowy Code download available at:InstanceManagement2006_06.exe(230 KB)

WCF: Instance Management Techniques For Developing WCF Apps

Using the Message Class. When you need an alternative way of creating outgoing message contents (for example, creating a message directly from a file on disk) instead of serializing .NET Framework objects.

Using the Message Class

When you need an alternative way of using incoming message contents (for example, when you want to apply an XSLT transformation to the raw XML contents) instead of deserializing into .NET Framework objects. When you need to deal with messages in a general way regardless of message contents (for example, when routing or forwarding messages when building a router, load-balancer, or a publish-subscribe system). The operation cannot have any out or ref parameters. There cannot be more than one input parameter. If the parameter is present, it must be either Message or a message contract type. The following code example contains a valid operation contract.

Using Sessions. If you use the default instancing behavior in WCF, all calls between a WCF client object are handled by the same service instance.

Using Sessions

Therefore, at the application level, you can think of a session as enabling application behavior similar to local call behavior. For example, when you create a local object: A constructor is called. All subsequent calls made to the WCF client object reference are processed by the same object instance. Just Released: Web Service Software Factory for WCF! - Tom Hollander's blog. <serviceDebug> Specifies debugging and help information features for a Windows Communication Foundation (WCF) service.


The following sections describe attributes, child elements, and parent elements. Attributes Child Elements None. Parent Elements You can also set httpsHelpPageEnabled and httpsHelpPageUrl to enable or disable the help page. The optional httpHelpPageBinding and httpHelpPageBinding attributes allow you to configure the bindings used to access the service web page. Service Station: WCF Messaging Fundamentals. Service Station WCF Messaging Fundamentals Aaron Skonnard Code download available at:ServiceStation2007_04.exe(161 KB) When you start pulling the layers away from Windows® Communication Foundation, you find a sophisticated XML-based messaging framework that offers a world of possibilities when connecting systems using a variety of protocols and formats.

Service Station: WCF Messaging Fundamentals

In this month's column, I am highlighting some of the key messaging features we can thank for such flexibility. This column assumes a basic understanding of the Windows Communication Foundation programming model. One of the primary goals of the Windows Communication Foundation messaging architecture is to provide a unified programming model while also allowing flexibility in how data is represented and messages are transmitted. Peer-to-Peer Networking. This message cannot support the operation because it has been copied - Nicholas Allen's Indigo Blog. Nicholas Allen's Indigo Blog. Matevz Gacnik's Weblog - WCF: Reliable Message Delivery. Windows Communication Foundation includes concepts which enable the developer to insist on reliably delivering messages in both directions.

Matevz Gacnik's Weblog - WCF: Reliable Message Delivery

The mechanism is actually transport agnostic and allows messages to be flown reliably from client to service and replies from service to client. Underneath, WS-ReliableMessaging (WS-RM) implementation is used. Click here for Microsoft's specification. Content is the same. WS-RM is based on a concept of a message sequence. After the sequence is initialized, there is an additional SOAP Header in messages. How to: Host and Run a Basic Windows Communication Foundation Service. This topic describes how to host a Windows Communication Foundation (WCF) service in a console application.

How to: Host and Run a Basic Windows Communication Foundation Service

This procedure consists of the following steps: Create a console application project to host the service. How to: Publish Metadata for a Service Using a Configuration File. Consume WCF BasicHttpBinding Services from ASMX Clients. The interoperability of WCF services has been touted quite a bit: just expose an endpoint using BasicHttpBinding and you will have a WS-I Basic Profile adherent web-service.

This is of course backed by some simple examples of math services, all RPC-style and none of them messaging-style services. We have for some time been consuming our BasicHttpBinding WCF services from a Flex 2 client and a WinForms smart client using a WCF generated client proxy (svcutil.exe). Just to be certain that our partners would have no problem setting up an application-to-application integration; I decided to test our services ASMX-style using "Add web reference" in Visual Studio (wsdl.exe).

This to ensure that the services are consumable from non-WCF systems, i.e. systems without the .NET 3 run-time installed. Well, surprise, surprise; it wasn't as straightforward as shown in the examples. [SEHException (0x80004005): External component has thrown an exception.] Versioning Windows Communication Foundation Services - Craig McMurtry's WebLog. To show how to properly deal with versioning, I’ve created a versioning decision tree. It shows you what you will need to do to handle every case, and it also shows you the consequences of each versioning choice you might make.

The white diamonds are versioning decisions, decisions about how you might version a service. The squares represent actions you will need to take as a result of your versioning choices. Squares that are green represent non-breaking changes. Squares that are red represent breaking changes. So let us follow the decision tree. Blog Archive » A Sample IWsdlExportExtension for WCF. I've been playing for a few hours with implementing an IWsdlExportExtension for Windows Communication Foundation in RC1, and thought some of you might be interested in this little sample. Basically you implement IWsdlExportExtension as a way to customize the WSDL generation process for a given service contract or service endpoint.

Here I'll show a simple extension that will add a default notice (say a copyright notice) to the WSDL and XSDs that WCF generates for a given service. Where to implement it IWsdlExportExtension needs to be implemented in either a Contract or an Endpoint Behavior itself. Either way is possible, but while trying this I found out some differences between both approaches that are not immediately apparent from the documentation. The first is that the IWsdlExportExtension interface is composed of two different methods: ExportContract() and ExportEndpoint(). WCF and WSDL. I've recently started using WCF to develop Web Services. It's a very compelling model that sits much better with a service oriented view of web services than ASMX. The flexibility it gives you is wonderful, you can have any executable host a web service, you can serialize your messages any way you want and you can use any transport.

However, if you're just doing standard SOAP, XML over HTTP then it's almost as easy as ASMX. Part of the change to a more standards oriented web service infratructure in WCF is the way it produces WSDL documents. Clemens Vasters - Saturday, February 26, 2005. [Read Part 1 and Part 2 first] Like with parts 1 and 2, I’ll stick with the “this isn’t RPC” theme for this 3rd part of this little series and will show how to flow free form XML from and to services. However, I will drop the “client”/”server” nomenclature from here on and will talk about endpoints. If you look at the contract below (along with the following explanation, of course), you’ll quickly figure out why – both parties in the “buyer”/”seller” conversation I am declaring in the contract below, act as client and as server at the same time. Clemens Vasters - A Weekend With Indigo. Part 1: Simple Messaging. Improving WCF Interoperability: Flattening your WSDL - Christian Weyer's Blog.

How to: Callback function with WCF - .net ready !!! The goal is to inform the client that the server process has progressed: Situation: You have to update a lot of data on the server. WCF Streaming: Upload files over HTTP. We have a web application that requires a robust and reliable document upload mechanism for very large files, and are currently using Microsoft BITS technology to achieve this. With the introduction of WCF in the solution, I set out to implement an upload service prototype using WCF and a HTTP binding. Using Message Contracts. WCF supports operations modeled on either the remote procedure call (RPC) style or the messaging style. In an RPC-style operation, you can use any serializable type, and you have access to the features that are available to local calls, such as multiple parameters and ref and out parameters.

In this style, the form of serialization chosen controls the structure of the data in the underlying messages, and the WCF runtime creates the messages to support the operation. AddressAccessDeniedException – Cause and Solution - Amit Lale's blog. While working with WCF service on Windows Vista, I came across the following error, which I am sure everybody who have created the services on previous versions (Windows XP and likes) and trying to migrate their services to Windows Vista would have encountered.

HTTP could not register URL Your process does not have access rights to this namespace (see for details). The error occurs due to the new security settings in Windows Vista. Most people are no longer going to be running with Administrator privileges by default like they were doing on earlier platforms. Data Contract Schema Reference. The DataContractSerializer also maps XSD to CLR types when Svcutil.exe is used to access Web Services Description Language (WSDL) or XSD documents and generate data contracts for services or clients. Only XML Schema instances that conform to requirements stated in this document can be mapped to CLR types using DataContractSerializer.

Support Levels The DataContractSerializer provides the following levels of support for a given XML Schema feature: Service Station: Serialization in Windows Communication Foundation. WCF with Transport security and self-signed certificate. Say you want to create a secure WCF channel and not having the client verifying the server's certificate (maybe because you are testing or the server's certificate is self-signed and you don't want to install that certificate in the client's trusted certificate's store). 1) Configure the server this way: 2) Force not verifying the server's certificate.

WCF-Creating Self-Signed Certificates - Damir Dobric Posts - WCF "Raw" programming model (Web) - receiving arbitrary data - Carlos' blog. REST in Windows Communication Foundation (WCF) How to: Create Temporary Certificates for Use During Development. Restws.pdf (application/pdf Object) Explaination of different timeout types. Clients and the Automatic Help Page in WCF WebHttp Services - The .NET Endpoint.