play_btnIn this article I would like to point out a useful way to accomplish something that would be really easy, but still have been annoying me for the last couple of months. Imagine that you would like to get some data of some type from one web service and pass it on to another. The data types on both server sides are the same, but the compiler won’t let you pass the type from the first service on to the next one. Casting won’t work either, not without implementing some kind of home made casting method.

This is really really annoying, since the scenario stated above is really common in the web service world. I will present a solution to this, using the wsdl command line tool when adding web references instead of the built-in tool in Visual Studio.

Continue reading »

 

lambdathumbnailThis article presents nothing new at all, but sometimes it is nice to freshen your memory when it comes to smooth stuff available in the .NET Framework. I will give a couple of examples to select, count and look up elements in a collection of objects, both using regular functions and by using lambda expressions. The methods I will use are available when using .NET Framework 3.5.

The complete documentation is available on MSDN, in System.Collection.Generic Namespace documentation.

Continue reading »

 

visualstudiologoThe other day I got a question from a colleague of mine, regarding the XML schema usage when defining a web service interface, like the one defined in series. The question was something like this: “How will the consumer of the web service react if the, from the XSD file, auto-generated class used as in and return parameters is updated?” I couldn’t give a straight answer, other than that I assumed it would be transparent to the consumer as long as no nodes were changed or removed and only new nodes were added to the schema. I decided to give it a try, using a really simple XSD and a couple of really simple web methods. I will give a schematic picture of the scenario that I will test out later on.

Continue reading »

 

bltoolkitRight after I published the previous post on the spatial data and BLToolkit components I decided to write a follow-up on that post. I wasn’t happy about the way I described the implementation of the new property and field attribute to support the SQL Server UdtTypeName property and spatial data types. I hope I will make it more clear how I accomplished the support for this here. Please read the previous post about this on, .

Continue reading »

 

In previous posts I have described my way to use the new spatial data types that come with SQL Server 2008. As shown in these posts ( and ) there is a little bit of work to make this run smoothly.

The other day I started to search for an alternative way to get rid of the dataset designer and the problems with UDTs (User Defined Types) and I bumped into the BLToolkit. This toolkit is a set of components to use when accessing data from a couple of providers, such as SQL Server. I looked at their tutorial and I liked what I saw. No dataset designer involved, just pure C# code and a couple of configuration settings and the work is done!

I will show how to use the spatial data types with BLToolkit, by presenting an extension of the toolkit to make the data access involving the new types a piece of cake. I have added a new attribute class to the toolkit making this possible.

Continue reading »

 

In this article the actual MVC like design will start to show up. The previous article, , didn’t really have anthing to do with MVC, so let’s begin!

Almost all design patterns will make re-use of code easier, but to accomplish this it is important to setup the Visual Studio Solution in such a way to support this. In the setup I will show here I will make way for re-use and the implementation of the MVC design.

Continue reading »

 

The other day I tried to compose an article about how to design an ASP.NET Web Service using an MVC like design pattern. I ended up with a huge article and decided to rewrite it and split it into a couple of smaller articles. I will try to write these articles as independent of each other as possible.

The idea to this subject came up when attending a course, held by Gabriel Svennerberg (http://www.svennerberg.com), dealing with Javascript, JSON and Javascript libraries such as JQuery and DOMAssistant. I wanted to try out the Ajax support in JQuery consuming web methods exposed by a regular SOAP web service as well as a WCF service. The business logic for these two interfaces were to be the same and their methods should have the same set of parameters, in and out. Therefore I wanted to create a couple of controllers and models to be used from the exposed methods. The methods themselves are the views in this MVC like architecture.

Continue reading »

 

In this article I will explain how to implement a custom SOAP extension to be able log all incoming and outgoing SOAP messages passing through a .NET web service.

Sometimes the IIS log file is not enough when debugging or looking for errors in a web service. Let’s say that the web service works like a charm in the development environment, but then when a third party user starts invoking methods in the production environment it stops doing what it was built for. Then you have a need for this little extension, letting you log and analyze all incoming messages as well as the outgoing.

Continue reading »

 

The other day I published a post about the spatial data support in SQL Server 2008 and using the new data types in a .NET application. I decided to write about “the rough way” and promised to publish an article about how to use DataSet designer and TableAdapters… Here it is!

I will try to present an example to accomplish the same result as in .

Continue reading »

 

As I wrote in my post the other day about SQL Server 2008, I would present some examples on how to use some of the new data types supported in SQL Server 2008 when developing .NET applications.

I “googled” the subject and found a couple of blogs about it. I wasn’t able to find anything on MSDN, except on the Forums. The information on the forums was somewhat useful, so I started off…

Continue reading »

© 2011 freddes.se Suffusion theme by Sayontan Sinha