WCF Complex Type AJAX Service Sample

This sample demonstrates how to use Windows Communication Foundation (WCF) to create an ASP.NET Asynchronous JavaScript and XML (AJAX) service that creates instances of complex types and sends them between service and client as JavaScript Object Notation (JSON).

C# (199.1 KB)
 
 
 
 
 
5 Star
(4)
2,143 times
Add to favorites
9/29/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • This WCF code doesn't work without www
    1 Posts | Last post January 07, 2012
    • I have configured the web.config as mentioned below, to run this code in .NET 3.5.
      
      <system.serviceModel>
          <serviceHostingEnvironment>
            <baseAddressPrefixFilters>
              <add prefix="http://www.subdomain.domain.com"/>
            </baseAddressPrefixFilters>
          </serviceHostingEnvironment>
        </system.serviceModel>
      
      This work perfectly if I use http://www.subdomain.domain.com, but if I use http://subdomain.domain.com it doesn't work and I get the following error.
      
      Server Error in '/' Application.
      --------------------------------------------------------------------------------
      
      The resource cannot be found. 
      Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 
      
      Requested URL: /calculator.svc
      
      
      --------------------------------------------------------------------------------
      Version Information: Microsoft .NET Framework Version:2.0.50727.5446; ASP.NET Version:2.0.50727.5456 
      
      For more information, I am trying to host this service on 1and1. Am I missing some configuration in web.config or onto the server ?