Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Visual Studio 2013 and .NET 4.5 Expert Cookbook
Visual Studio 2013 and .NET 4.5 Expert Cookbook

Visual Studio 2013 and .NET 4.5 Expert Cookbook: Over 30 recipes to successfully mix the powerful capabilities of Visual Studio 2013 with .NET 4.5

eBook
€24.99 €36.99
Paperback
€45.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Visual Studio 2013 and .NET 4.5 Expert Cookbook

Chapter 2. Enhancements to WCF 4.5

In this chapter, we will cover the following recipes:

  • Understanding Windows Communication Foundation (WCF) by creating a basic application
  • Hosting a WCF service in different hosting environments
  • Streaming data over a network using a WCF service
  • Writing a REST-based WCF service
  • Creating a WCF service using the Open Data Protocol standards
  • Extending a WCF service (service extensibility)

Introduction

In today's world, enterprise applications are the key to any enterprise. We are in the age of devices. People use one or multiple devices to be connected with the external world. Business processes need shared services, which can be consumed by these devices. Basically, an application can either consume data directly from the database tier or use loosely coupling models and get data from a hosted service. Most enterprises prefer to have a loose coupling on data so that their apps are maintained and also to sustain a clear separation of the application and business logic. Most of the big giants expose their data using standard compliant web-based services and the clients use them to consume data. Some of the services are also hosted behind the secure socket layer and require a secure encrypted connection between the host and the client to perform a data transfer.

Modern enterprises rely on standardized data points so heavily that many of them are now sharing public content...

Understanding Windows Communication Foundation (WCF) by creating a basic application

WCF is easy and simple. A large number of APIs are built inside .NET, which provides an easy way to implement a WCF service. Visual Studio provides the appropriate tools to create proxy classes automatically when a service reference is taken into a project such that the user only needs to configure the service with a proper endpoint address and the service will start working. In this recipe, we are going to look at the internal details and the API that you need to consider to create and connect services. We are not going to use the tools of Visual Studio to build this service. We will later explain how to make use of Visual Studio to quickly create services in other recipes.

Getting ready

Building a service with Visual Studio is very easy and automatic but if we consider not using it, we will have to manually perform a lot of plumbing to ensure that everything works correctly. We will use a class library...

Hosting a WCF service in different hosting environments

Hosting a service is an important part of any service. Coming from web services, WCF exposes more relevant APIs to handle different kinds of hosting environments. A WCF service can be hosted virtually anywhere, starting from a simple Console Application, a Windows Service, IIS, or even other hosting services such as Windows Activation Service. After the service is hosted on an environment, the service endpoint for a particular service gets exposed. When the host process runs, WCF will be available using the configured endpoints.

Hosting a WCF service in different hosting environments

Any .NET application runs using a Windows process. Inside a process, you can host multiple .NET application domains. Each application domain logically separates the execution environment from another. WCF requires ServiceHost to host a worker process inside the application domain. Similarly, each application domain can host multiple worker processes. Each application represents service host-to-host multiple...

Streaming data over a network using a WCF service

WCF is an easy way to implement a distributed application and also provides built-in functions to handle complex problems. Streaming is one of the most important problems we always need to consider while working over a network in distributed applications. Applications deployed over a cloud sometimes need download or upload capabilities. Downloading a large file over a network using a buffered read technique such as a SOAP-based response can really be a bottleneck to the system. Reading a very large file from the memory can terminate the server process with OutofMemoryException.

WCF allows you to send byte streams through the communication channel, or even allows you to implement a service that might take the stream start location from the service call and send the stream from a certain location. It allows you to use normal HttpBinding to support streams that have download or upload capabilities in the connected client-server architecture...

Introduction


In today's world, enterprise applications are the key to any enterprise. We are in the age of devices. People use one or multiple devices to be connected with the external world. Business processes need shared services, which can be consumed by these devices. Basically, an application can either consume data directly from the database tier or use loosely coupling models and get data from a hosted service. Most enterprises prefer to have a loose coupling on data so that their apps are maintained and also to sustain a clear separation of the application and business logic. Most of the big giants expose their data using standard compliant web-based services and the clients use them to consume data. Some of the services are also hosted behind the secure socket layer and require a secure encrypted connection between the host and the client to perform a data transfer.

Modern enterprises rely on standardized data points so heavily that many of them are now sharing public content through...

Understanding Windows Communication Foundation (WCF) by creating a basic application


WCF is easy and simple. A large number of APIs are built inside .NET, which provides an easy way to implement a WCF service. Visual Studio provides the appropriate tools to create proxy classes automatically when a service reference is taken into a project such that the user only needs to configure the service with a proper endpoint address and the service will start working. In this recipe, we are going to look at the internal details and the API that you need to consider to create and connect services. We are not going to use the tools of Visual Studio to build this service. We will later explain how to make use of Visual Studio to quickly create services in other recipes.

Getting ready

Building a service with Visual Studio is very easy and automatic but if we consider not using it, we will have to manually perform a lot of plumbing to ensure that everything works correctly. We will use a class library to...

Hosting a WCF service in different hosting environments


Hosting a service is an important part of any service. Coming from web services, WCF exposes more relevant APIs to handle different kinds of hosting environments. A WCF service can be hosted virtually anywhere, starting from a simple Console Application, a Windows Service, IIS, or even other hosting services such as Windows Activation Service. After the service is hosted on an environment, the service endpoint for a particular service gets exposed. When the host process runs, WCF will be available using the configured endpoints.

Any .NET application runs using a Windows process. Inside a process, you can host multiple .NET application domains. Each application domain logically separates the execution environment from another. WCF requires ServiceHost to host a worker process inside the application domain. Similarly, each application domain can host multiple worker processes. Each application represents service host-to-host multiple endpoints...

Left arrow icon Right arrow icon

Description

If you are a Visual Studio 2013 or .NET developer who would like to sharpen your existing skill set and adapt to new .NET technologies, this is the book for you. A basic understanding of .NET and C# is required.

What you will learn

  • Get to grips with Visual Studio 2013 IDE and its various components utilizing its tools to debug your code better Understand the Windows Phone 8 development environment and gain practical experience on app development on the platform Create service-oriented applications using WCF and study advanced use cases on implementing a RESTful service with WCF Test your application inside Visual Studio 2013 IDE and advanced use case scenarios to handle testing issues Effectively utilize the various components of Team Foundation Server for better management of code Extend Visual Studio 2013 IDE to add your own custom changes enhancing your experience Discover the advanced usage of cloud computing with Windows Azure and its various components

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 25, 2014
Length: 308 pages
Edition : 1st
Language : English
ISBN-13 : 9781849689724
Vendor :
Microsoft
Category :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 25, 2014
Length: 308 pages
Edition : 1st
Language : English
ISBN-13 : 9781849689724
Vendor :
Microsoft
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 83.98
Visual Studio 2013 and .NET 4.5 Expert Cookbook
€45.99
Visual Studio 2013 Cookbook
€37.99
Total 83.98 Stars icon

Table of Contents

8 Chapters
1. A Guide to Debugging with Visual Studio Chevron down icon Chevron up icon
2. Enhancements to WCF 4.5 Chevron down icon Chevron up icon
3. Building a Touch-sensitive Device Application Using Windows Phone 8 Chevron down icon Chevron up icon
4. Working with Team Foundation Server Chevron down icon Chevron up icon
5. Testing Applications Using Visual Studio 2013 Chevron down icon Chevron up icon
6. Extending the Visual Studio IDE Chevron down icon Chevron up icon
7. Understanding Cloud Computing with Windows Azure Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(3 Ratings)
5 star 33.3%
4 star 66.7%
3 star 0%
2 star 0%
1 star 0%
robert switzer May 30, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Dies ist ein äußerst nützliches Buch für jeden Entwickler, der sich sehr intensiv mit .NET befassen muss. Hier habe ich viele hilfreiche Tipps gefunden, die mir bei der Entwicklung mit Visual Studio weitergebracht haben. Und was mich am meisten erfreut, ist die Tatsache, dass ich die Entwicklung von verteilten Services mit WCF als hoffnungslos kompliziert und beinahe unmöglich fast aufgegeben habe. Aber dieses Buch hat mir geholfen, erste funktionierenden verteilten Services mit WCF zum Laufen zu bringen. Dies ist ungefähr das 5. Buch mit dessen Hilfe ich dies versucht habe.Die Art, wie Sur seine 'Rezepte' gestaltet, ist sehr leicht nachzuvollziehen. Ich kann dieses Buch uneingeschränkt für jeden empfehlen, der komplexe Anwendungen mit Visual Studio und .NET entwickeln soll.
Amazon Verified review Amazon
Rene Rendon Jr Jun 05, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Full disclosure first, I did receive a review copy. That being said I found good and bad things about this book. While it does say cookbook do not expect 20 to 30 recipes per chapter. The book covers three to four topics per subject in the chapter. You get some general topics like WCF, Windows Phone, Debugging, Extending Studio, Testing, and Azure. Windows Phone is constantly changing so while useful, sometimes the platform is in flux. You do get a step by step per topic or recipe. I could follow them but at times the author skipped a slight step or two like what did he name the project. You need to refer to the source code to get some of these steps. A true step by step includes everything but to keep the book smaller I think some of it is not there. Again refer to the source code. I will also point out this is not a book for beginners now it will serve well as introduction to some of these topics mentioned and you go get some examples. A chapter on TFS is included but you need access to TFS server. I worked with the Visual Studio online and I could follow some of it. I also have some familiarity with it as I use it for work but sometimes you need to reread the topics again. One excellent thing the author did was provide links on every topic where you could read for further clarification. More authors should do this.ProsBroad coverage of range of topicsStep by step coding examplesLinks at end of topics for further coverageCons depending on your point of viewMay seem too general. It gives you stuff to start and some different coverage but still may need more to understandSamples step by steps may miss small steps like names of projectsNot for beginners (not a con per se as this is a cookbook not a beginner book)Technology is subject to change (Azure, Windows Phone)I found new stuff in the testing and debugging and T4 templates. You should find something useful in this book.
Amazon Verified review Amazon
jammesm Jun 04, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book is a "must-have" as an introduction of the Visual Studio 2013. It helps to learn the various components and technologies of .NET development with Visual Studio 2013 . Clear examples to learn the technologies. More over, many wise advices that any developer should know.The books should bring you clear vision on this development tools and the .NET technologies . I hope you will appreciate it as i did.I recommended it greatly !!!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.