Posts

Web Services and WCF services

Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service, following table provides detailed difference between them. Features Web Service WCF Hosting It can be hosted in IIS It can be hosted in IIS, windows activation service, Self-hosting, Windows service Programming [WebService] attribute has to be added to the class [ServiceContraact] attribute has to be added to the class Model [WebMethod] attribute represents the method exposed to client [OperationContract] attribute represents the method exposed to client Operation One-way, Request- Response are the different operations supported in web service One-Way, Request-Response, Duplex are different type of operations supported in WCF XML System.Xml.serialization name space is used for se...

Exploring our Lazy Class

We’ll dive in by writing an generic class that represents the delayed (and lazy) computation, Lazy<T>.  Actually it is just a class that will execute a piece of code once somebody asks for the a result. It will also need to cache this result, so that we can enforce that the code is at most executed once. It is pretty easy to represent this in C#: for the ‘piece of code’ that we need to execute, we can use a Func   delegate. We’ll also use generics, since this ‘piece of code’ can return any .NET type. public class Lazy<T> {     private Func<T> func;     private T result;     private bool hasValue;     public Lazy(Func<T> func)     {         this .func = func;         this .hasValue = false ;     }     public T Value     {      ...

Server Variables in .Net Web Application

Server Variables Variable Description ALL_HTTP Returns all HTTP headers sent by the client. Always prefixed with HTTP_ and capitalized ALL_RAW Returns all headers in raw form APPL_MD_PATH Returns the meta base path for the application for the ISAPI DLL APPL_PHYSICAL_PATH Returns the physical path corresponding to the meta base path AUTH_PASSWORD Returns the value entered in the client's authentication dialog AUTH_TYPE The authentication method that the server uses to validate users AUTH_USER Returns the raw authenticated user name CERT_COOKIE Returns the unique ID for client certificate as a string CERT_FLAGS bit0 is set to 1 if the client certificate is present and bit1 is set to 1 if the cCertification authority of the client certificate is not valid CERT_ISSUER Returns the issuer field of the client certificate CERT_KEYSIZE Returns the number of bits in Secure Sockets Layer connection key size CERT_SECRETKEYSIZE Returns the number of bits in server certificate priv...

MVC and MVVM Architecture

What is MVVM? MVVM is Model View ViewModel. Its a design pattern used widely with Silverlight and WPF applications. We can say it as a successor of MVC pattern. In MVC - Model View Controller , now controller is the view model. View-Model is responsible for exposing the data objects from the Model in such a way that view objects are easily managed and consumed. Why should I use MVVM? 1. MVVM is a great design paatern for UI. 2. Using MVVM you write better, lesser and more manageable code. 3. Being layered changes in UI/views donot majorly affect the other layers. 4. Using MVVM you can create a simple, testable, robust framework on which any WPF/Silverlight applications can thrive. Difference between MVC and MVVM: In MVC input is directed at the Controller first, not the view. Its a Controller that is interfaced with to kick off some functionality. There is a many-to-one relationship between the Controller and the View. That's because a single controller may select di...

Free Windows Azure Exam

Microsoft  just announced the availability of beta exam for Windows  Azure . This is beta exam for Exam 71-583, Pro: Designing and Developing Windows Azure  Applications . This exam will be available for free until November 17th. Take this free opportunity to experience a Microsoft certifications exam. Also, it will help you prepare for the main the exam later. If you pass this beta exam, the credit will be added to your transcript and you will not need to take the exam in its released form.   Exam 71-583, Pro: Designing and Developing Windows Azure Applications counts as credit towards MCPD: Windows Azure Developer   4   For more details, visit  http://blogs.technet.com/b/betaexams/archive/2010/10/13/windows-azure-beta-exam-announcement.aspx

Hosting WCF in IIS(9 Steps)

These are the 9 Different steps to Host WCF Application in IIS. 1. Create a Strong Name File - In order to get a Public Key 2. Copy the DLL in the Bin Folder to the Global Assembly Folder 3. Get the name including PublicKeyToken of the DLL eg: Test.WCF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=someToken - Get it from the Properties of the DLL in the Global Assembly Cache - 4. Add it to the svc File eg: <%@ServiceHost Language="C#" Debug="true"   Service="Test.WCF.TestService,Test.WCF,   Version=1.0.0.0, Culture=neutral, PublicKeyToken=51dc0966f715a3f8" %> 5. Create a New Folder in IIS (intpub/wwwroot) 6. Copy the essential files from the project folder to the created New Folder 7. Set Permission to the folder via IIS 8. Run resetiis command 9. Test the Web Service

Free Microsoft Silverlight 4 Exam

Register for Beta Exam  71-506,  TS: Silverlight 4, Development You are invited to take beta exam 71-506, TS: Silverlight 4, Development. If you pass the beta exam, the exam credit will be added to your transcript and you will not need to take the exam in its released form. The 71-xxx identifier is used for registering for beta versions of MCP exams, when the exam is released in its final form the 70-xxx identifier is used for registration. By participating in beta exams, you have the opportunity to provide the Microsoft Certification program with feedback about exam content, which is integral to development of exams in their released version. We depend on the contributions of experienced IT professionals and developers as we continually improve exam content and maintain the value of Microsoft certifications. Exam 71-506, TS: Silverlight, Development counts as credit towards the following certification(s). MCTS: Silverlight 4 Development Availability Registration beg...