Archive

Posts Tagged ‘.Net Framework 3.5’

Testing WCF services using MSTest

April 9th, 2009 raymondr No comments

However it’s possible to test your WCF services using unit test by just referencing your service implementation (see Ploeh’s Blog) You gain a lot of benefit if you use the WCF infra structure to test your services.

For Example, did you ever get the error message during integration test (or worse, production) because your message couldn’t be serialized because of a null value. This wouldn’t happen if your unit test were using WCF. Espacially when you have large messages with a lot of elements.

See Howard’s blog how to implement this.


Categories: .Net Tags: , , ,

WCF Multipart WSDL Download

March 30th, 2009 raymondr No comments

In the old days of ASMX webservices it was very easy to distribute the wsdl file of your service to other people, for example if you develop a service that’s not available to that person yet. The only thing you had to do was browse to http://myserver/mywebservice.asmx?wsdl and save the result of it. But nowadays the wsdl provided by your wcf service contains multiple files, the wsdl files uses import elements to include these file in the wsdl.

If you use svcutil.exe, wsdl.exe or some other tool to create a webservice client and reference a webservice directly this doesn’t matter. But this week I had to distribute my wsdl file and my service isn’t published yet. The only option was to download the wsdl file and each included file by hand.

After some searching for a neat solution I found a blog post by Mike Hadlow for downloading a wsdl and all included files to local disc. His solution makes use of the DiscoveryClientProtocol class in the .Net framework. This piece of code downloads all files but leaves the references of the xsd files pointing to the original url of the service. But this was also easy to solve. The WriteAll method of the DiscoveryClientProtocol class also creates a information file with the original location and the new filename. The only thing that has to be done is to replace the original urls with their local values.

Wsdl Download Executable
Wsdl Download source code

Categories: .Net, Dev Tags: , ,

TFS stops working after .Net Framework 3.5 SP1 update

March 11th, 2009 raymondr No comments

After installing the .Net 3.5 sp1 framework update on my Team Foundation Server, I noticed the hard way my TFS wasn’t working any more. Thanks to a little line below the error I noticed my TFS server was configured to ASP.Net 1.1 instead of ASP.Net 2.0. After changing this back to 2.0 (for every site and virtual directory!) every things works smooth again.

Categories: .Net, Dev Tags: ,

Optimistic Concurrency Control with MS Entity Framework and WCF or Webservices

October 26th, 2008 raymondr 2 comments

The Entity Framework makes it very simple to implement Optimistic Concurrency Control (OCC). To use this feature in combination with a disconnected application (Website/webservices), the recommend practice is to send both the original and the updated values of the object. This causes much larger network requests and could be done much more elegant.

How to use Optimistic Concurrency Control in ADO.Net Entity Framework using Webservices or WCF

Optimistic Concurrency Control in Entity framework
For using OCC in the Entity Framework you’ve got 2 options:
- using Stored Procedures
- Set the Concurrency Property of an object.

Read more…