Tag Archives: WCF

Integrating with systems behind a firewall from CRM Online using Windows Azure Service Bus Relay

The Windows Azure Service Bus Relay enables applications hosted anywhere with an internet connection to securely call back to applications hosted in your own datacenter behind a firewall.  The CRM 2011 SDK offers documentation on how to use the Windows Azure Service Bus Relay from CRM Online.  Here’s a link to the documentation that describes the scenario:

http://dkdt.me/HOzzrr

The video below demonstrates a working example of the end to end scenario and walks you through the configuration.

http://dkdt.me/HOzy6X 

NOTE: The video shows my WCF service running in a console application for simplicity.  Many will want to host their services in IIS.  See IIS hosting of Wcf Services with Servicebus Endpoints for more details.

@devkeydet

PubSec Dev Dinner on External Data and Services with SharePoint 2010

My old team is having a developer dinner tomorrow night titled Developing SharePoint 2010 Solutions Using External Data and Services.  See here for more details at http://bit.ly/kPUq5n.

“…

What you will learn

SharePoint 2010 allows developers to work with both internal and external data using Business Connectivity Services (BCS), Excel Services, Access Services and custom WCF services. During the presentation we will discuss and demonstrate several common usage scenarios.

  • Bringing SQL Server data to SharePoint using BCS
  • Sharing Excel Data using PowerPivot for SharePoint
  • Publishing Access Database applications to SharePoint
  • Sharing secure data using BCS and the secure store service
  • Creating Silverlight Using WCF RIA services for SharePoint

…”

Help make Microsoft developer technologies better!

Follow devkeydet on Twitter

Ron Jacobs just blogged about how .NET developers can provide feature feedback and vote on WCF/WF features.

http://blogs.msdn.com/b/rjacobs/archive/2011/04/14/how-you-can-make-wf-wcf-better.aspx

Many Microsoft product teams are doing this nowadays. It still surprises me how many .NET developers don’t realize these feature voting sites exist. In addition to WF/WCF, I am aware of these:

http://wpdev.uservoice.com/forums/110705-app-platform

https://windowsphone7community.uservoice.com/forums/84435-feature-feedback

http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions

http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions

http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions

http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions

http://dotnet.uservoice.com/forums/87171-visual-basic-content-requests

http://dotnet.uservoice.com/forums/57026-wcf-ria-services

http://www.mygreatwindowsazureidea.com/pages/34192-windows-azure-feature-voting

http://www.mygreatwindowsazureidea.com/forums/35889-microsoft-codename-dallas-feature-voting

http://www.mygreatwindowsazureidea.com/forums/44459-sql-azure-data-sync-feature-voting

http://www.mygreatwindowsazureidea.com/forums/34685-sql-azure-feature-voting

http://www.mygreatwindowsazureidea.com/forums/100417-sql-azure-reporting-feature-voting

http://www.mygreatwindowsazureidea.com/forums/40626-windows-azure-appfabric-feature-voting

http://www.mygreatwindowsazureidea.com/forums/103009-windows-azure-code-samples-voting

http://www.mygreatwindowsazureidea.com/forums/103403-windows-azure-content-voting

http://aspnet.uservoice.com/forums/41199-general

http://aspnet.uservoice.com/forums/41201-asp-net-mvc

http://aspnet.uservoice.com/forums/41202-asp-net-webforms

http://aspnet.uservoice.com/forums/50615-orchard

http://aspnet.uservoice.com/forums/100405-performance

http://aspnet.uservoice.com/forums/41233-visual-studio-performance-feedback

Let me know in the comments if I’ve missed any.  I’ll add them.

OQuery – A fluent API to build OData url queries sans LINQ

Yesterday, I blogged about a solution to compose OData / WCF Data Service queries using LINQ for situations where LINQ enabled client libraries don’t exist (i.e. JavaScript and Windows Phone 7).

http://blogs.msdn.com/b/devkeydet/archive/2011/02/02/data-services-odata-client-for-windows-phone-7-and-linq.aspx

The post is all about using LINQPad as a tool to write your LINQ queries, then using the feature in LINQPad that gives you the url query translation.  Well today, a new MSDN Code Callery project just popped up called OQuery that offers another approach that doesn’t require using an external tool such as LINQPad:

http://code.msdn.microsoft.com/oquery

Here’s the description from the project page:

“OQuery is a library which gives you a fluent style interface for building OData Url Fragments in javascript or C#.
Neither Javascript or Silverlight for WP7 support LINQ and so this library in those cases.”

What are you waiting for?  Go check it out!

Follow devkeydet on Twitter

Data Services (OData) Client for Windows Phone 7 and LINQ

 

The WCF Data Services Team released a client library to make it easier to interact with OData services from Windows Phone 7. 

http://bit.ly/wp7odatalib

The major caveat (and bummer) with the library is that “LINQ support in the client library has been removed as the core support is not yet available on the phone platform.”  I have a tip/trick for LINQ lovers like me that will allow you to still use LINQ query syntax to compose your query (kind/sorta).  A tool I find useful to when writing OData queries on Windows Phone 7 is LINQPad.  I use the tool to write LINQ queries against my data service, then get the url syntax query translated for me:

clip_image002

Once I get my LINQ query right, I just paste the http string into my app.  I’m still surprised about how many people aren’t aware of LINQPad.  You must check it out if you use LINQ in your day to day coding (which I am sure most of you do now).  You can learn more about using LINQPad against OData services (amongst many other uses) from the product site:

http://www.linqpad.net/

NOTE: This tip/trick is very useful when querying OData services from JavaScript as well.  Here are two helpful posts on using jQuery to interact with an OData service:

http://stephenwalther.com/blog/archive/2010/04/01/netflix-jquery-jsonp-and-odata.aspx

http://stephenwalther.com/blog/archive/2010/03/30/using-jquery-and-odata-to-insert-a-database-record.aspx

Hope this helps save you some time!

Follow devkeydet on Twitter

Entity Framework N-Tier

digg_url = “http://blogs.msdn.com/devkeydet/archive/2010/04/22/entity-framework-n-tier.aspx”;digg_title = “Entity Framework N-Tier”;digg_bgcolor = “#555555”;digg_skin = “normal”;http://digg.com/tools/diggthis.jsdigg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

This is a topic I have customer conversations about quite often.  I just found my latest “watch this, then let’s talk about it” reference.  Tony Sneed just published a webinar about the topic.  Definitely worth watching if you are interested in this scenario.

http://blog.tonysneed.com/2010/04/21/webinar-n-tier-entity-framework-with-dtos/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+DevelopmentorInstructors+(Developmentor+Instructor’s+Aggregated+Feed)&utm_content=Google+Reader

Consuming REST services using HttpClient

digg_url = “http://blogs.msdn.com/devkeydet/archive/2010/02/08/consuming-rest-services-using-httpclient.aspx”;digg_title = “Consuming REST services using HttpClient”;digg_bgcolor = “#555555”;digg_skin = “normal”;http://digg.com/tools/diggthis.jsdigg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

If you have a need to consume REST Services from .NET Framework based code, then you should really have look at the WCF Rest Starter Kit.  There is a handy class called HttpClient that is, in my opinion, provides the best / cleanest way to consume REST services at the http level.  Essentially, it gives you the ability to make http calls as easy as:

image

There is so much more to HttpClient than the little snippet above, including ways to easily hydrate / deserialize the response of the REST service into a .NET types.  You have quite a bit of power / control over the common REST service consumption scenarios.  There’s a nice little blog post over at The .NET Endpoint blog which covers HttpClient.  The BEST starting point, again my opinion, for learning about HttpClient is these two Ch. 9 screencasts by Aaron Skonnard:

https://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Consuming-REST-services-with-HttpClient/

https://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Processing-Message-Content-using-HttpClient-class/

Once you’ve watched the screencasts and read the blog post, then you will probably want to learn a bit more about the WCF REST Starter Kit.  Here’s a great overview of the kit (also by Aaron Skonnard):

http://msdn.microsoft.com/en-us/library/ee391967.aspx