Web Services

Getting Started to become MCSD–Web Application Solutions Developer

March 30, 2013 .NET, .NET Framework, .NET Framework 4.5, ASP.NET, ASP.NET 4.5, ASP.NET MVC, Azure, Certification, Community, CSS 3, HTML, HTML5, IIS, IIS8, JavaScript, JumpStarts, KnowledgeBase, Microsoft, Microsoft Learning, MSDN, SignalR, VisualStudio, VS2012, Web, Web API, Web Services, Windowz Azure No comments

In this article I will introduce you to the necessary requirements for preparing and earning MCSD – Web Apps Solutions Developer certification.

In my previous article Permanent Link to Getting Started to become an MCSD in Windows Store Apps, I have introduced you to the MCSD – Windows Store Apps Developer certification exams and requirements.

Similarity between MCSD – Win Store Apps development using HTML5 and MCSD – Web Apps is that initial exam is same for both the certification titles. 70-480 is the initial exam that is required for earning both the certifications.

Earning an MCSD: Web Applications certification will qualify you for a position as a web developer or web administrator.

Below are the 3 exams required to pass to earn the title MCSD: Web Applications

  1. 70-480 – Programming in HTML5 with JavaScript and CSS3
  2. 70-486 – Developing ASP.NET MVC 4 Web Applications
  3. 70-487 – Developing Windows Azure and Web Services

Note: This MCSD certification requires you to show continued ability to perform in your chosen solution area by completing a recertification exam every two years.

Online Preparation materials: (Provided to you by Channel9 and Microsoft Virtual Academy)

70-480 – Developing in HTML5 with JavaScript and CSS3 Jump Start – FREE

70-486 –  Building Web Apps with ASP.NET Jump Start – FREE – by Scott Hanselman and Jon Galloway

70-487 – Developing Windows Azure and Web Services – no jumpstarts available yet.

Know more about MCSD: Web Applications | from Microsoft Learning

Continue your learning and all the best to you – if you are planning to take MCSD on Web Applications.

Visual Studio 2012 RTM available for download

August 16, 2012 .NET, .NET Framework, ADO.NET, All, ASP.NET, ASP.NET MVC, Azure Tools, Microsoft, Silverlight, VB.NET, VisualStudio, VS2012, WCF, Web Services, Windows, WinForms, WPF, WWF No comments

Microsoft has released Visual Studio 2012 RTM for MSDN subscribers on 15th AUG 2012. MSDN Subscribers can download it from MSDN here, logging in with your msdn credentials.

image

Those who doesn’t have MSDN subscription can download trial versions from below links from Microsoft Download Center

Download Microsoft Visual Studio Ultimate 2012

There are two types of installers

1. Web Installer (vs_ultimate.exe): – which will download all necessary packages from the download source location before installation.

2. Download a DVD5 ISO image (VS2012_ULT_ENU.iso): you can use it for offline installation. The ISO image contains all the necessary software’s for the installation. You can download the ISO image directly and install it.

Associated download packages:

Download Microsoft Visual Studio 2012 SDK

Download Microsoft Visual Studio 2012 Visualization & Modeling SDK

Download Microsoft Visual Studio Test Professional 2012

WebSockets endpoint/transport support with WCF 4.5 *New*

April 1, 2012 .NET, All, Communication, HTML5, Microsoft, VisualStudio, VS11, WCF, Web, Web Services, Web Sockets No comments

WebSocket is a web technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket. The WebSocket API is being standardized by the W3C, and the WebSocket protocol has been standardized by the IETF as RFC 6455.

WebSocket is designed to be implemented in web browsers and web servers, but it can be used by any client or server application. The WebSocket protocol makes possible more interaction between a browser and a web site, facilitating live content and the creation of real-time games. This is made possible by providing a standardized way for the server to send content to the browser without being solicited by the client, and allowing for messages to be passed back and forth while keeping the connection open. In this way a two-way (bi-direction) ongoing conversation can take place between a browser and the server. A similar effect has been done in non-standardized ways using stop-gap technologies such as comet.

In addition, the communications are done over the regular TCP port number 80, which is of benefit for those environments which block non-standard Internet connections using a firewall. WebSocket protocol is currently supported in several browsers including Firefox and Google Chrome. WebSocket also requires web applications on the server to be able to support it.  [ information reference: Wikipedia ]

Web Sockets endpoint support in WCF 4.5 and .NET Framework 4.5

With upcoming WCF 4.5 – Microsoft has added support for exposing your WCF Services over Web Sockets. Two new bindings have been added to support communication over a WebSocket transport.

1. NetHttpBinding   – A binding designed for consuming HTTP or WebSocket services that uses binary encoding by default.

2. NetHttpsBinding  – A secure binding designed for consuming HTTP or WebSocket services that uses binary encoding by default.

* Using the above bindings now we can create Services listening over Web Sockets using WCF 4.5.

** Web Sockets hosting support has been introduced with IIS 8.0 in Windows 8 and Windows Server 8 beta.

[ information reference: MSDN ]

More References:

http://en.wikipedia.org/wiki/WebSocket 

http://websocket.org/

Generating WCF/WebService proxy class using SvcUtil.exe

February 22, 2011 .NET, .NET Framework, All, ASP.NET, ASP.NET MVC, C#.NET, Frameworks, General, IIS, IIS 7.5, Microsoft, VB.NET, VisualStudio, VS2010, WCF, Web Services 12 comments

Introduction

This article  prepared based on my recent explorations on creating generic WCF/WebService proxy class using SvcUtil.exe tool which is part of .NET Framework Runtime. SvcUtil.exe helps me in creating a single Proxy Stub class for my WCF/web service, which can be directly reused in any project when necessary, without the need to Add Web Reference or Add Service Reference through the Visual Studio 2010 solution explorer.

ServiceModel Metadata Utility Tool (Svcutil.exe)

The ServiceModel Metadata Utility tool is used to generate service model code from metadata documents and metadata documents from service model code. The ServiceModel Metadata Utility Tool can be found at the Windows SDK installation location, specifically, C:Program FilesMicrosoft SDKsWindowsv6.0Bin.

Svcutil.exe generates the client based on the WSDL or policy file received from the service.

Usage Syntax :

svcutil /t:code http://<service_url>/out:<file_name>.cs /config:<file_name>.config

Options Reference :

Option Description
/config:<configFile> Specifies the filename for the generated configuration file.Default: output.config
/language:<language> Specifies the programming language to use for code generation. You should provide either a language name registered in the Machine.config file, or the fully-qualified name of a class that inherits from CodeDomProvider.Values: c#, cs, csharp, vb, visualbasic, c++, cpp

Default: csharp

Short form: /l

/mergeConfig Merges the generated configuration into an existing file, instead of overwriting the existing file.
/messageContract Generates Message Contract types.Short Form: /mc
/namespace:<string,string> Specifies a mapping from a WSDL or XML Schema targetNamespace to a CLR namespace. Using ‘*’ for the targetNamespace maps all targetNamespaces without an explicit mapping to that CLR namespace.To make sure that the message contract name does not collide with operation name, you should either qualify the type reference with ::, or make sure the names are unique.

Default: Derived from the target namespace of the schema document for Data Contracts. The default namespace is used for all other generated types.

Short Form: /n

/out:<file> Specifies the file name for the generated code.Default: Derived from the WSDL definition name, WSDL service name or target namespace of one of the schemas.

Short form: /o

/serializable Generates classes marked with the Serializable Attribute.Short Form: /s
/targetClientVersion Specify which version of .NET Framework the application is targetting. Valid values are Version30 and Version35. The default value is Version30.Short Form: /tcv

Version30: Use /tcv:Version30 if you are generating code for clients that use .NET Framework 3.0.

Version35: Use /tcv:Version35 if you are generating code for clients that use .NET Framework 3.5.

/reference:<file path> References types in the specified assembly. When generating clients, use this option to specify assemblies that might contain types that represent the metadata being imported.Short Form: /r

more on the usage refer to http://msdn.microsoft.com/en-us/library/aa347733.aspx

A Simple Example:

I have an ASP.NET Web Service hosted on one of my domains.

I wanted to created Proxy Stub class from my WSDL url. So I used the following command in “Visual Studio Command Prompt”

svcutil /out:P:BookSearchSvcRefStub.cs http://dotnetcook.com/BookSearch.asmx?WSDL /config:P:BookSearch.config

And the command Generated the  files…

P:BookSearchSvcRefStub.cs -> C#  Code of Proxy Stub class

P:BookSearch.config -> Service Model configuration settings are saved to BookSearch.config

I just included the BookSearchSvcRefStub.cs in my project and made necessary changes to the namespace to meet with the name space of my class library or project. Copied the necessary *.config entries to my solution. Voila!! my code is ready to work.

Conclusion

When you add a Web Reference or Service Reference to a Visual Studio project by right clicking on the solution explorer on Visual Studio, Visual Studio internally input the above svcutil.exe command to generate Proxy class and emits  output to your Visual Studio project itself and configuration entries will be updated to your project App.config or Web.config.

But in some certain scenarios we do not want to depend on Visual Studio to add Service Reference, to make sure we will not include any unnecessary entries created by Visual Studio. This will make sure we do not alter the Service proxy code accidently, just like sometimes we do using “Update Service References”, which updates the proxy class contents to latest version downloaded from the Service Uri and we might breaking existing code base.  Also if we made any customization to the Proxy class and all the changes will be over written when Service Reference are updated. To avoid such incidents it’s better we generate Proxy Stub classes and reuse it where ever necessary.

There are more interesting commands you can use it with SvcUtil.exe to generate metadata or proxy code from a Web/WCF Service URL in C# or VB.NET.

Refer to http://msdn.microsoft.com/en-us/library/aa347733.aspx for more details.

Hope this helps.