Posts

Barracuda WAF

Image
A Web application firewall (WAF) is a firewall that monitors, filters or blocks data packets as they travel to and from a Web application. A WAF can be either network-based, host-based or cloud-based and is often deployed through a proxy and placed in front of one or more Web applications. Barracuda Web Application Firewall enables administrators to configure security rules with varying degrees of granularity. A security policy, comprised of security settings, is shared by multiple applications.  A newly configured service originally uses the ‘default security policy’, so all URLs and Parameters are compared to the ‘default security policy’ settings. The Barracuda Web Application Firewall applies rules to traffic and generates a log of rule violations viewable in the BASIC > Web Firewall Logs page.   You can use the Web Firewall Logs to evaluate rule violations, and when warranted, create exceptions to the rule violated. Exceptions can apply globally if they mod...

How to create proxy class for WCF service

Svcutil.exe is used to create service model code. You can generate proxy class and .config files from wsdl, xsd etc..  It generates client code from running services or static metadata documents.  Below are the various functionalities provided by this tool : 1) Exports metadata documents from compiled code. 2) Validates compiled service code. 3) Downloads metadata documents from running services. 4) Generates serialization code. This tool is available in the following location C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools path will get changed and it depends on the .net framework installed on your machine. Go to the visual studio command prompt and type the above path prefix with "cd" and space and type SvcUtil.exe http://localhost/mywebservice.wsdl  below is the complete syntax of svcutil command execution from the command prompt. Syntax: Svcutil.exe /t:code /d:<<targetlocation>> /r:<reference assemblies if any>> /l...

ASP.NET WCF Service Bindings

WCF supports different protocols for communicating with the other services and allowing access to client. This blog describes the difference between different protocols used with WCF services. BasicHttpBinding:   It uses HTTP transport protocol and it is of text/xml message encoding type. It does not support security. There is no reliability and also It does not support transactions. WSHttpBinding:  It uses HTTP/HTTPS transport protocol. It is a secure and inter-operable binding and It supports Message security. Reliability is disabled by default. It support WS- Atomic Transactions. WSDualHttpBinding:  It uses HTTP transport protocol and reliable messaging is enabled by default. It support WS- Atomic Transactions. NetTcpBinding:   It uses TCP as a transport protocol and It supports Binary Message encoding. also, It supports Transport security mode. Reliable messaging is disabled and it supports OLE Transactions. NetPeerTcpBinding:   It supports P2P t...

WCF Services in ASP.NET

WCF(Windows Communication Foundation) is a Programming model which we write services and can unify the technologies like COM+ , MSMQ , .Net remoting ,  Web services etc. WCF has 3 main components: 1. Address 2. Binding 3. Contract Address : It is actually the URL which denoted the location of the service. i.e. where the service is located. Service can have more than one address and each of which is unique. Binding : It defines the way of communication of service. Service communicate with the help of protocols like TCP, HTTP ,MSMQ etc. Contract : It specifies the interface between client and the server. Interface contains  just attributes.  Communication takes to and from endpoints. Endpoints defines the location to which messages are sent and received. These location contains the address, binding and contract. There are 4 types of contracts 1. Service Contract: It is used to define the interface. 2. Operation Contract: It is used to defines the inside method interface. ...

ASP.NET Web Site Performance Tips

When we develop any web site using  any technology  then we should look at the performance along with functionality. because once we deploy web site on public host then huge no.of request s may hit the website from different devices with different network configurations hence performance of web site is the primary aspect when you create web site. Below are some tips which we can adopt in any technology. Caching   If same data is required among multiple users,  Caching  can be used. Cache stores the data on application server's cache memory. So each time when a request is made the data will come from cache memory than Database.Example, On a particular page load you want a grid of multiple records to be loaded and data to display is same for all the users.In such scenario you can place the data in cache memory. It will boost the performance to a certain height. Make Static files as external Make JavaScript and CSS external i.e create separate files and ...

SQL SERVER global variables and Functions

SQL SERVER global variables and Functions like @@ROWCOUNT, SCOPE_IDENTITY, DBCC CHECKIDENT, IDENTITY_INSERT @@ROWCOUNT:- It returns the total number of rows affected in the last operation .i.e. SELECT/INSERT/UPDATE/DELETE SCOPE_IDENTITY: It returns the last value of the identity column of any table in the current session and the current scope. It must be referred immediately after INSERT, SELECT INTO, or bulk copy statement is completed or after an INSERT TRIGGER to get the correct value. @@IDENTITY: It returns the last value of the identity column of any table in the current session, across all scopes. Failed statements and transactions can change the current identity for a table and create gaps in the identity column values. The identity value is never rolled back even though the transaction that tried to insert the value into the table is not committed. IDENT_CURRENT: It returns the last value of the identity column for a specific table in any session and any scope. It wor...

Date Time methods ASP.NET

ASP.NET Microsoft Technology provides date time with the use of SYSTEM TIME method of operating system. Declaring Date Time  We can use date and time value by declaring with DateTime variable. Do not forget to add 'System' namespace Refer below code-snippet: DateTime dt = new DateTime(); Playing with DateTime We can get Date & Time value using above declared DateTime variable.  We can also get millisecond, second, minute, hour, day, week, month, year. Parts of DateTime Followings are the two main parts of DATETIME: DATE TIME Lets discuss these in more details: DATE 'Date' contains three part of  day, month and year . Take a look into code-snippet mentioned below, where we are getting the default System Date and time, using Microsoft built in system DateTime Variable. using System; namespace DateTimeDemo { class Program { static void Main(string[] args) { DateTime DT = new DateTime(); Console.WriteLine(...

SOLID Design Pattern Principles-C#

Here I would like to explain Solid Principles in C# Acronym for SOLID Principles are S-Single responsibility principle O-Open closed Principle L-Liskov substitution principle I-Interface segregation principle D-Dependency principle Single Responsibility principle This principal indicates that a entity or a class should have one and only one responsibility Ex: Customer class should contain information about real life customer. Add the properties and methods related to customer like Properties: customername,CustomerID..etc  Methods : InsertCustomer,UpdateCustomer,DeleteCustomer,Validate public class Customer { public string customerName { get; set; } public string customerID { get; set; } public void Insert() { //insert logic } public void Update() { //insert logic } public void Delete() { //Delete logic } public void Validate() { ...