Skip to main content


Showing posts from August, 2014

Increasing request limit quota in WCF/REST Service

Customizing  webHttpBinding  in web.config and referencing with  bindingConfiguration  in endpoint element <system.serviceModel>     <behaviors>       <endpointBehaviors>         <behavior name="AmmuEndPointServiceBehavior">           <webHttp />         </behavior>       </endpointBehaviors>       <serviceBehaviors>         <behavior name="AmmuServiceBehavior">           <serviceMetadata httpGetEnabled="true" />           <serviceDebug includeExceptionDetailInFaults="true" />         </behavior>       </serviceBehaviors>     </behaviors>     <bindings>       <!-- Customizations for REST service -->       <webHttpBinding>         <!-- Limits set to 10 MB (specified value in bytes) -->         <binding name="AmmuBinding" maxReceivedMessageSize="10485760" maxBufferPoolSize="10485760" maxBufferSize="10

HTTP status codes

1xx – Informational:  These status codes indicate a provisional response. The client should be prepared to receive one or more 1xx responses before receiving a regular response. 100 - Continue. 101 - Switching protocols. 2xx – Success:  This class of status codes indicates that the server successfully accepted the client request. 200 - OK. The client request has succeeded. 201 - Created. 202 - Accepted. 203 - Non-authoritative information. 204 - No content. 205 - Reset content. 206 - Partial content. 3xx – Redirection:  The client browser must take more action to complete the request. For example, the browser may have to request a different page on the server or repeat the request by using a proxy server. 301 - Moved Permanently 302 - Object moved Temporarily 303 - See Other 304 - Not modified. 307 - Temporary redirect. 4xx - Client Error:  An error occurs, and the client appears to be at fault. For example, the client may request a page that

Removing HTML tags from Input String in Sql Server

CREATE FUNCTION [dbo].[FN_AMMU_REMOVE_HTML_TAGS] ( @INPUT_STRING NVARCHAR(MAX) )     RETURNS NVARCHAR(MAX) AS BEGIN     DECLARE @Start INT, @End INT, @Length INT;         WHILE CHARINDEX('<', @INPUT_STRING) > 0 AND CHARINDEX('>', @INPUT_STRING, CHARINDEX('<', @INPUT_STRING)) > 0     BEGIN         SET @Start  = CHARINDEX('<', @INPUT_STRING);         SET @End    = CHARINDEX('>', @INPUT_STRING, CHARINDEX('<', @INPUT_STRING));         SET @Length = (@End - @Start) + 1;                 IF @Length > 0         BEGIN             SET @INPUT_STRING = STUFF(@INPUT_STRING, @Start, @Length, '')         END      END         RETURN RTRIM(@INPUT_STRING); END