Archive | November, 2010

Use DomainServices as Service References

30 Nov

DomainServices was introduces as part of WCF RIA Services. WCF RIA Services offers a solution on how we can build a middle-tier having clients and servers.

Using a DomainService in a Silverlight client is very easy using WCF RIA Services – the WCF RIA Services link between the client and the server will automatically generate the client side code that we need to communicate with the server.

2010-11-30_161311

To avoid writing middle-tier functionality more than once we want to be able to reuse the DomainService and the logic inside of it to all of our projects. Most project types beside Silverlight do not understand WCF RIA Services yet. But as a DomainService ultimately just is a WCF Service we can just make a normal Service Reference (or ChannelFactory) to it and reuse the logic.

For that to work you need to make a few adjustments to the project hosting the service. When you add a DomainService to your project a DomainServiceHttpModule http module is added to your web.config and ASP.NET compatibility is turned on.

2010-11-30_163517

The DomainServiceHttpModule dynamically generates a WCF Service based on our DomainService. In this sample I have added a DomainService called DomainService1 in the root of my ASP.NET web project called WebApplication1. The web project is using port 6479. Based on this information I can point to my dynamically generated WCF Service from my browser:

http://localhost:6479/Services/WebApplication1-DomainService1.svc

2010-11-30_172225

If I try to make a Service Reference to the WCF Service I will get an error:

There was no endpoint listening at http://localhost:6479/Services/WebApplication1-DomainService1.svc that could accept the message.

Before I can make a Service Reference to the service I need to define an endpoint in the web.config. First I need to add a custom configuration section for DomainServices within System.ServiceModel.

2010-11-30_200119

Using the RIA Services Toolkit I can now define a SOAP endpoint (I need to add a reference to Microsoft.ServiceModel.DomainServices.Hosting found in the Microsoft SDKs/RIA Services/v1.0/Toolkit/Libraries folder).

2010-11-30_200643

Finally I can add a Service Reference to the service and use it as if it was a regular WCF Service.

2010-11-30_200816

2010-11-30_200917

You can download the full sample from http://bit.ly/dOVMVR.

by xamlgeek
@thomasmartinsen

Windows Phone 7 – fup eller fakta

26 Nov

Windows Phone 7 er endelig kommet på markedet og telefonerne er lige så langsomt begyndt at komme i handlen. Der er stadig en masse features vi som udviklere ønsker os og der er sikkert også nogle features som forbrugerne ønsker sig – der skal jo være noget at komme med i en fremtidig version.

Der går en del rygter om Windows Phone 7 – nogle er sande andre er usande. Over den kommende periode vil jeg skrive en række posts, hvor jeg ser på nogle af rygterne. Udover at give min egen og et par andre udviklers menig tilkende, har jeg aftalt med Microsoft, at de i videst mulige omfang, vil kommentere på de enkelte rygter.

Alle posts bliver skrevet så neutralt og objektivt som muligt, men I skal vide, at jeg er Microsoft MVP og lever af Microsofts teknologier.

by xamlgeek
@thomasmartinsen

150+ members in WPDEV

23 Nov

Just a few months ago we started Windows Phone 7 Developers in Denmark (aka WPDEV) and today we passed 150 members – YEAH :)

During the past month we did three 2-days WP7 code camps around Denmark with more then 100 participants. We have received a lot of positive feedback – thanks! As mentioned in a previous post you can download the full sourcecode, slides and hands-on labs from http://wp7codecamp2010.codeplex.com/.

Our next event is on 15th December 2010. The event is a deep dive into the world of push notifications (fantastic!):

Understand Push Notifications on Windows Phone 7
http://www.eventbrite.com/event/1003819451

by xamlgeek
@thomasmartinsen

Silverlight 4 kurser

22 Nov

I januar 2011 afholder Bluefragments to Silverlight 4 kurser – et 2-dags introduktions kursus og et 2-dags avanceret kursus. Begge kurser har fokus på udvikling af line-of-business applikationer og henvender sig til udviklere.

Introduktion til Silverlight 4
17.-18. januar 2011

Kurset kommer igennem de fleste centrale dele af Silverlight og kursisten vil lære hvordan man han/hun integrerer Silverlight med eksisterende ASP.NET applikationer.

Kurset henvender sig til udviklere som vil i gang med at udvikle Rich Internet Applications (RIA) med Microsoft Silverlight 4. Det forventes at deltagerne har erfaring med C#/VB.NET (C# benyttes under kurset), Visual Studio og .NET Frameworket. Erfaring med ASP.NET og Windows Presentation Foundation (WPF) er en fordel, men ikke et krav.

http://www.eventbrite.com/event/1038782025

Avanceret Silverlight 4
20.-21. januar 2011

Kurset kommer dybt ned i de dele af Silverlight, der anvendes til udvikling af enterprise løsninger – der er fokus på arkitektur, sikkerhed og patterns.

Kurset henvender sig til udviklere som har nogen erfaring med Silverlight og/eller WPF. Det forventes at deltagerne har erfaring med C#/VB.NET (C# benyttes under kurset), Visual Studio og .NET Frameworket.

http://www.eventbrite.com/event/1038784031

by xamlgeek
@thomasmartinsen

Start page in Azure

19 Nov

I have just completed a very exiting Silverlight project hosted in Windows Azure. One challenge I had during the development was setting the start page in the web role project.

During development this of course wasn’t an issue – I just right clicked the page I wanted as startpage as selected “Set as Start Page”.

When I deployed to Azure the start page wasn’t recognized. To set the start page in Azure it is necessary to do one of two things: 1) Implement a start page called “Default.aspx” or 2) specify the start page in the web.config file:

2010-11-19_002433

Setting the defaultDocument value in the web.config fixed my issue.

by xamlgeek
@thomasmartinsen

My thoughts on the TechEd 2010 keynote

8 Nov

Earlier today I attended the TechEd 2010 keynote in Berlin. I insisted on attending the keynote even though I often get disappointed – unfortunately today was no exception.

TechEd is a conference for IT pros and developers. Some years Microsoft has held a conference for IT pros and a separate conference for developers. I understand the advantages of bringing the two groups together but I also see some disadvantages. The keynote today was one of them.

The keynote introduced some new exiting things like Office 365 and Windows 7 SP1. If I was an IT pro it was probably a very good keynote and as a developer it’s important to know about server products. Even though I’m really excited about Office 365 I’m not attending a conference to hear about stuff like that. I would have loved to hear some thoughts and visions on how Microsoft sees the future regarding development tools, languages and stuff like that.

Maybe separate keynotes for IT pros and developers are all it requires?!

Tomorrow I’m attending a lot of sessions and I’m sure it will be great fun and I will hear a lot of exciting stuff.

by xamlgeek
@thomasmartinsen

Danmarksmesterskabet i mobile applikationer

5 Nov

Den 6. december 2010 afholder Mobile Monday i København konkurrencen AppCircus, hvor Danmarks sejeste mobilapplikation skal findes og kåres. Den rette vinder har muligheden for at komme med til den globale AppCircus konkurrence i Barcelona.

Mobile Monday har nu åbnet for tilmelding til konkurrencen i København og såvel privat personer som virksomheder kan tilmelde sig. Det er gratis og fristen er den 21. november 2010. Selve konkurrencen finder sted mandag den 6. december kl. 16:00 til 19:00 i kontorhotellet Ordnung.nu, Lersø Park alle 107, 2100 København Ø.

Læs mere på http://www.mobilemonday.dk/

by xamlgeek
@thomasmartinsen

Windows Phone 7 Toolkit November release

3 Nov

Second release of the Windows Phone 7 Toolkit (november release) is now ready for download at codeplex – http://silverlight.codeplex.com.

The new version contains some new components:

  • AutoCompleteBox
  • ListPicker
  • LongListSelector
  • Page Transitions (finally!)

The existing components:

  • GestureService/GestureListener
  • ContextMenu
  • DatePicker
  • TimePicker
  • ToggleSwitch
  • WrapPanel

As always you can download the full source code under Microsoft Public License and sample applications for all controls in the toolkit.

by xamlgeek 
twitter.com/thomasmartinsen

Wrapping up after WP7 code camp tour 2010

2 Nov

During October 2010 the Danish Windows Phone usergroup (wpdev.dk) traveled from city to city in Denmark to talk about Windows Phone 7 developement. All-in-all we had more then 100 developers visit us.

Thank you to all of you for being part of the code camp tour – and thanks to all members of the core group. Thank you Trifork and hedal:kruse:brohus for letting us use your offices and also big thank you to Microsoft Denmark for sponsoring pizza and cola to all events.

You will be able to download all slides, handson labs and code samples from http://wp7codecamp2010.codeplex.com.

CodeCamp 301010 (20) WP_000000 WP_000006
WP_000022 WP_000026 Code Camp 301010 (11)
WP_000003 Code Camp 301010 (6) WP_000055

by xamlgeek 
twitter.com/thomasmartinsen

Follow

Get every new post delivered to your Inbox.

Join 1,356 other followers