Techaray

Shailendra Saxena's Technical Blog

Web Site project V/S Web Application projects in ASP.Net

clock October 30, 2012 23:44 by author ShailendraSaxena

In ASP.Net we have Web site projects and Web application projects.below are few differences between them.

 

Web Sites project

Web Application projects

Can Be accessed by any body

Can be accessed by the authorized users

Contains no project file (.csproj or .vbproj).

Contains project file (.csproj or .vbproj)

Most of the times contains static pages

Contains dynamic pages, contains business logic and data is stored in RDBMS

Can never be implemented as a desktop application.

May have exactly the same functionality as a desktop application. It may in fact be a desktop application with a web interface.

Users have access rights to most of the pages

Users have access rights as per the role.



The remote server returned an error (415) Cannot process the message

clock October 29, 2012 09:51 by author ShailendraSaxena
Hi,

I Created my WCF Service and it was working properly when i was making its service reference in my local machine.

But the problem came when I hosted this WCF Service in the Production Server.
When I was taking its reference in my local machine  I got following error.

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8'  In WCF.

I had   <serviceMetadata httpGetEnabled="true"/>   in the web.config. but still I got the error.

I resolved this issues by adding another endpoint 'mex' as below in my web.config.


<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
 
after adding above endpoint I got the service reference in my Client Application.
 
Please try If you face the similar problem.


 
Happy Coding!
 
Shailendra Saxena


The server has rejected the client credentials WCF Error NetTCpBinding

clock October 26, 2012 11:14 by author ShailendraSaxena

Hi,

When I created my WCF Service and Host it on server I found following Error.

“The server has rejected the client credentials”.

I resolved it with following changes.

1. At Server Side in Web.Config i added [<security mode="None"></security>] as example given below.

<netTcpBinding>
        <binding name="netTcpBinding"    maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="22365478"/>
     <security mode="None"></security>
        </binding>
      </netTcpBinding>

2. On Client Side Also in my App.config [<security mode="None"></security>] as example given below.

 <netTcpBinding>
                <binding name="NetTcpBinding_IService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                    hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                    maxReceivedMessageSize="65536">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                  <security mode="None"></security>
                </binding>
            </netTcpBinding>
 
Good Luck.
 
Happy Coding.


The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' In WCF

clock October 25, 2012 05:23 by author ShailendraSaxena
Hi,

I Created my WCF Service and it was working properly when i was making its service reference in my local machine.

But the problem came when I hosted this WCF Service in the Production Server.
When I was taking its reference in my local machine  I got following error.

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8'  In WCF.

I had   <serviceMetadata httpGetEnabled="true"/>   in the web.config. but still I got the error.

I resolved this issues by adding another endpoint 'mex' as below in my web.config.


<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
 
after adding above endpoint I got the service reference in my Client Application.
 
Please try If you face the similar problem.


 
Happy Coding!
 
Shailendra Saxena


The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' In WCF

clock October 25, 2012 05:23 by author ShailendraSaxena
Hi,

I Created my WCF Service and it was working properly when i was making its service reference in my local machine.

But the problem came when I hosted this WCF Service in the Production Server.
When I was taking its reference in my local machine  I got following error.

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8'  In WCF.

I had   <serviceMetadata httpGetEnabled="true"/>   in the web.config. but still I got the error.

I resolved this issues by adding another endpoint 'mex' as below in my web.config.


<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
 
after adding above endpoint I got the service reference in my Client Application.
 
Please try If you face the similar problem.


 
Happy Coding!
 
Shailendra Saxena


The remote server returned an error: (415) Cannot process the message in WCF

clock October 25, 2012 05:22 by author ShailendraSaxena
Hi,

I Created my WCF Service and it was working properly when i was making its service reference in my local machine.

But the problem came when I hosted this WCF Service in the Production Server.
When I was taking its reference in my local machine  I got following error.

The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8'  In WCF.

I had   <serviceMetadata httpGetEnabled="true"/>   in the web.config. but still I got the error.

I resolved this issues by adding another endpoint 'mex' as below in my web.config.


<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
 
after adding above endpoint I got the service reference in my Client Application.
 
Please try If you face the similar problem.


 
Happy Coding!
 
Shailendra Saxena


ASP.NET Ajax framework failed to load client side framework

clock October 24, 2012 08:32 by author ShailendraSaxena

ASP.NET Ajax framework failed to load client side framework

 I face below errors at a same time.

ASP.Net Ajax framework failed to load client side framework
Microsoft JScript runtime error: 'Sys' is undefined
and Telerik is undefined.
 
If somebody else also got this error, below is what i did to resolve this error.
I had below in my web.config 
 
<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd"
                 type="Telerik.Web.UI.WebResource" verb="*"
                 preCondition="integratedMode,runtimeVersionv2.0"/>  
 
 
I removed runtimeversion2.0 and it worked well.
 
Just to update you that it was working well in IIS6.0 but error occured when i deploy it on IIS7.0
 
So the above entry was in <system.webServer> tag, which is basically for iis7 specific.
 
In google there are lots of other solution are given to resolve this issue.
It took my lot of time to resolve this issue.


Steps to Host WCF Service with netTCPBinding in IIS 7.0

clock October 24, 2012 08:31 by author ShailendraSaxena

Hi,

Below are the steps to Host WCF Service with netTCPBinding in IIS7.0

Step1. Add Non-HTTP Activation from Features Wizard.
Step 2. Following services should be enabled for net.tcp
Net.TCP Listener Adapter and Net TCP Port Sharing Service.

 

 

 

Step 3.  IIS should be enabled with net.tcp Binding. Go to IISàright Click à enable binding à add net.tcp with Port No.

 

 

 

Step 4. Go to your WCf Service in IIS, right Click manage applicationà advance settingsà  add net.tcp  in enabled protocols.

 

Step 5.  In your WCF service web.config file you should have mex endpoint.

 

Step 6. TCP Port should be enabled for inbound and out bound calls.
Hopes it will help you.


Sql Server Function Returns date in YYYYMMDD Format

clock October 24, 2012 08:20 by author ShailendraSaxena

Create FUNCTION [dbo].[fn_YMDDate]
(
      @dateParam     varchar(10)
)
RETURNS Varchar(10)
AS
BEGIN
      DECLARE @Return Varchar(10)

      Declare @YYYY  varchar(4)
      Declare @MM  varchar(2)
      Declare @DD  varchar(2)
      Declare @TMP varchar(2)
      Declare @strRemain  varchar(10)
      Declare @strSeprator  varchar(1)
      Declare @strOutPutSeprator  varchar(1)


      if  CHARINDEX ('/',@dateParam ,1)>0
            Begin
                  set @strSeprator='/'
            End
      Else
      if  CHARINDEX ('-',@dateParam ,1)>0
            Begin
                  set @strSeprator='-'
            End

      if  CHARINDEX ('.',@dateParam ,1)>0
            Begin
                  set @strSeprator='.'
            End           
       set @strOutPutSeprator = '.'    

      if  CHARINDEX (@strSeprator,@dateParam ,1)>0
            Begin
                  if  CHARINDEX (@strSeprator,@dateParam ,1) > 4 /*YYYY/MM/DD Format*/
                        Begin

                              set @YYYY=SUBSTRING(@dateParam,1 ,CHARINDEX(@strSeprator,@dateParam,1))
                              set @strRemain=SUBSTRING(@dateParam, CHARINDEX (@strSeprator,@dateParam,1)+1,len(@dateParam))
                              set @MM=SUBSTRING(@strRemain,1 ,(CHARINDEX(@strSeprator,@strRemain,1)-1))
                              set @DD=SUBSTRING(@strRemain, CHARINDEX (@strSeprator,@strRemain,1)+1,len(@strRemain))
                              IF CAST(@MM As int) > 12
                                BEGIN
                                    SET @TMP = @MM
                                    SET @MM = @DD
                                    SET @DD = @TMP
                                END

                        END
                  else
                        Begin
                              set @DD=SUBSTRING(@dateParam,1 ,(CHARINDEX (@strSeprator,@dateParam,1)-1))
                              set @strRemain=SUBSTRING(@dateParam, CHARINDEX (@strSeprator,@dateParam,1)+1,len(@dateParam))
                              set @MM=SUBSTRING(@strRemain,1,(CHARINDEX(@strSeprator,@strRemain,1)-1))
                              set @YYYY=SUBSTRING(@strRemain, CHARINDEX (@strSeprator,@strRemain,1)+1,len(@strRemain))

                              IF CAST(@MM As int) > 12
                                BEGIN
                                    SET @TMP = @MM
                                    SET @MM = @DD
                                    SET @DD = @TMP
                                END
                             
                        End

                        if len(@MM)=1
                       Begin
                              Set @MM='0'+@MM
                        End
                        if len(@DD)=1
                        Begin
                              Set @DD='0' +@DD
                        End

                        SET @Return =  @YYYY + @strOutPutSeprator + @MM + @strOutPutSeprator + @DD

     END
      RETURN ISNULL(@Return,'')
END



Search

Calendar

<<  August 2017  >>
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

Archive

Tags

Categories


Visitors

FlagCounter

Flag Counter

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign In