background preloader

WCF

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. 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. If this is the case, you must give read access privileges to the process's account for the file containing the private key. 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. 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.

A destructor is called when the object reference is destroyed. Initiating operations are those that must be called as the first operation of a new session. Terminating operations, conversely, are those that must be called as the last message in an existing session. For example, the ICalculatorSession contract used in the preceding example requires that the WCF client object first call the Clear operation prior to any other operation and that the session with this WCF client object should terminate when it calls the Equals operation.

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.

<serviceDebug>

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: 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.

Consume WCF BasicHttpBinding Services from ASMX Clients

This is of course backed by some simple examples of math services, all RPC-style and none of them messaging-style services. 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. 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. 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. In contrast to the previous two examples, I am not using the raw Message class, but I move one notch up on the messaging stack and use the XmlSerializer formatting mode for Indigo, which allows me to flow the contents of an XmlNode between services just like it can be done today with ASP.NET Web Services. In addition, I show how custom message headers can be declared and flowed with (really: inside) messages.

Clemens Vasters - A Weekend With Indigo. Part 1: Simple Messaging. This weekend I will create some samples for myself as a foundation for learning and fiddling around with Indigo bindings. 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.

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.

This enables developers who are not familiar with SOAP and SOAP messages to quickly and easily create and use service applications. The following code example shows a service operation modeled on the RPC style. 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). 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. Service Station: Serialization in Windows Communication Foundation. Service Station. 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 - developers.de. WCF "Raw" programming model (Web) - receiving arbitrary data - Carlos' blog. The previous post mentioned how to return arbitrary data from WCF services. To receive data, however, there is one extra step, which I'll try to explain here. Like returning arbitrary data, the key for accepting arbitrary (in any format) data is for a method to have a parameter with type System.IO.Stream. This parameter needs to be the single parameter which is passed in the body of the request. 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.