Blue Theme Orange Theme Green Theme Red Theme
 
World Class ASP.NET Hosting – Click Here for 3 Months Free/NO Setup Fee!
Home | Forums | Videos | Photos | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » WCF » An Introduction to Windows Communication Foundation (WCF)

An Introduction to Windows Communication Foundation (WCF)

WCF combines the functionality from ASP.NET Web Services, .NET Remoting, Message Queuing and Enterprise Services.

Total page views :  22181
Total downloads :  680
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
WCF.zip
 
Become a Sponsor


WCF Overview

1. What Is WCF?

WCF stands for Windows Communication Foundations.

WCF combines the functionality from ASP.NET Web Services, .NET Remoting, Message Queuing and Enterprise Services.

WCF1.gif

WCF provides the following features,

  • Hosting For Component & Services
    WCF Service can be hosted in ASP.NET Runtime, a Windows Service, a COM+ Component or just a Windows form application for peer-to-peer computing.
  • Declarative Behavior
    Similar to ASP.NET Web Services, attributes can be used for WCF Services e.g. ServiceContract(), OperationContract, DataContract and DataMember
  • Communication Channels
    Similar to .NET Remoting WCF Services are flexible in changing the channels. WCF offers multiple channels to communicate using HTTP, TCP or an IPC channel.
  • Security
  • Extensibility

2. Understanding WCF-

These days we are creating the software/application which should be capable of communication with other applications as well. Communication with other application simply means either sharing/exchanging the data or the sharing the logic.

Now, this communication may be of two kinds

  1. Over Intranet (Same Network/Platform i.e. .NET Application to .NET Application)
  2.  Over Internet (Cross Platform may be ASP.NET to J2EE Application)

Suppose we are writing a .NET Software with n-tier architecture in which Win Form Client needs to communicate with Server in the same network. In such case we may go for .NET Remoting for communication between Client and Server.

Suppose, once our software mentioned above is ready, we need to expose some business logic to another J2EE application. This J2EE application is supposed to use our .NET Application's logic over WWW. In such case we will have to write new ASP.NET Web Service to expose the logic.
 
Picture shown below shows the limitation of .NET Remoting

WCF2.gif

WCF helps us to overcome this kind of Scenario, as WCF Service can be used as a .NET Remoting Component and ASP.NET Web Services as well.

WCF3.gif

3. WCF in Real Time Scenario

Suppose a 7 Star hotel has contacted you for software which will help the organization to managing the hotel's room booking say "Room Booking System". Apart from its own features software should be capable of

  • Communication with already running software within the hotel's network for help desk purpose. (.NET Windows Form Application)
  • Communication with already running software on Tourism Office for booking of rooms. (A J2EE Application supposed to access the application over WWW)

Off course we are suppose to implement the application using Microsoft.NET Technology.
Now, as we know that in order to communicate with another .NET application within same network .NET Remoting is the best option. But as per our requirement our application should be capable of interaction with another J2EE application over WWW. So we can't go for .NET Remoting. ASP.NET web services may work fine but the correct option for now would be WCF Service.

WCF4.gif

4. Difference between WCF and ASP.NET Web Services

Windows Communication Foundation (WCF) ASP.NET Web Service
WCF supports multiple bindings HTTP, WSHTTP, TCP, MSMQ. ASP.NET Web Services supports only HTTP binding.
WCF supports Atomic Transactions*. ASP.NET Web Services does not support Atomic Transactions*.
By default WCF uses SOAP for sending and receiving the messages. But WCF can support any kind of message format not only SOAP. ASP.NET Web Services can send and receive messages via the SOAP only.
The System.Runtime.Serialization.DataContract and System.Runtime.Serialization.DataMember attributes of the WCF's System.Runtime.Serialization assembly can be added for .NET types to indicate that instances of the type are to be serialized into XML, and which particular fields or properties of the type are to be serialized. ASP.NET Web Services uses XmlSerializer to translate the XML data (Message Send or received) into .NET objects.


Atomic Transactions

Following example describes that what does it mean by Atomic Transactions
 
Consider that bank A and bank B want to interact with someone's account at the same time. Both banks want to withdraw from the account and the account has $10.00 in it. If bank A takes $7.00 and at the same time bank B tries to get $5.00, what will happen? When they start the transaction each bank believes there is $10.00 available in the account. When one of them finishes the other one will find there is not enough money to finish the transaction.
 
This scenario is common for computer systems and you can see it many times in memory management, IO operations and database interactions.
Atomic transactions are a way to avoid this problem. They simply lock on a transaction and do not allow any other transaction to interact with the resource. If anything fails during the Atomic transaction, everything will return to the state before the transaction started.

5. WCF Communication Model

WCF follows Client-Server Architecture. Communication between Client and Server are established with the help of Endpoints exposed by the WCF Service. Endpoints are nothing but the locations defined by service through which message can be sent and received. Service may have multiple end points.

WCF5.gif

6. Know some terms/ Kew words

  • ServiceContract
    Service contracts describe the operations supported by a service, the message exchange pattern they use, and the format of each message. The service contract may be an interface or class for generating a service description. A service must implement at least one service contract. Interface or class supposed to be exposed as a service should be decorated with ServiceContractAttribute
  • OperationContract
    Methods in the interface or class which are supposed to be exposed as a service should be decorated with OperationContractAttribute.
  • DataContract
    Data contracts describe how a CLR type maps to schema. A data contract may be understood as a class or interface which is mapped to database and are supposed to exploit by WCF Service. This class or interface needs to be decorated with DataContract attribute.
  • DataMember
    Properties or database table columns in the DataContract class which are supposed to be used by WCF Service should be decorated with DataMember attribute.

7. WCF Binding Comparisons

As we discussed in point 4 that WCF supports multiple bindings e.g. HTTP, TCP and etc. Following table describes about the various bindings supported by WCF. Bindings are configurable and can be achived by changing web.config file.

Binding Class Name Transport Message Encoding Message Version Security Mode RM Tx Flow*
BasicHttpBinding HTTP Text SOAP 1.1 None X X
WSHttpBinding HTTP Text SOAP 1.2
WS-A 1.0
Message Disabled WS-AT
WSDualHttpBinding HTTP Text SOAP 1.2
WS-A 1.0
Message Enabled WS-AT
WSFederationHttpBinding HTTP Text SOAP 1.2
WS-A 1.0
Message Enabled WS-AT
NetTcpBinding TCP Binary SOAP 1.2 Transport Disabled Ole Tx
NetPeerTcpBinding P2P Binary SOAP 1.2 Transport X X
NetNamedPipesBinding Named Pipes Binary SOAP 1.2 Transport X Ole Tx
NetMsmqBinding MSMQ Binary SOAP 1.2 Message X X
MsmqIntegrationBinding MSMQ X** X Transport X X
CustomBinding You decide You decide You decide You decide You decide You decide
Where,
  1. X = Not Supported
  2. X = Not Supported
  3. WS-A = WS-Addressing
  4. WS-AT = WS-AtomicTransaction
  5. OleTx = OleTransactions
  6. * Transaction flow is always disabled by default, but when you enable it, these are the default tx protocols
  7. * This binding doesn't use a WCF message encoding – instead it lets you choose a pre-WCF serialization format

8. How to Create a Sample WCF Application with VS2008?

8.1 Create/ Manage database

Before proceeding toward the WCF Service Creation, we need to create a database say, "WCF" with one table having following schema

WCF6.gif

Where, ReservationId is an auto generated Primary Key column.

Note: You may also restore the backup of the database given along with the sample application.

8.2 Create WCF Service

  1. Open Visual Studio
  2. Go to File -> New -> Project
  3. From the left panel, select Web node of your language VB.NET/C#.NET
  4. Now among the templates you will see WCF Service Application
  5. Select the same (WCF Service Application)
  6. Give Suitable Name (Say Practice.WCF) and Click on OK button.

    WCF7.gif
     
  7. Modify the connection strings section of web.config file of the WCF Service

    <connectionStrings>

    <add name="con" connectionString="Data Source=PRODSK0542;Initial Catalog=WCF;User
    Id=sa;Password=Swayam1;
    " providerName="System.Data.SqlClient"/>

    </connectionStrings>
     

  8. By default Visual Studio would create a Service and an Interface Service1.svc and IService1.cs
  9. Add new class RoomReservationRequest.cs (DataContract)
  10. Import the name space System.Runtime.Serialization; if not imported
  11. Create property with same data type for each columns present into the RoomReservationRequest table. Decorate RoomReservationRequest.cs class with [DataContract] attribute and each property with [DataMember].
     

    namespace Practice.WCF

    {

        [DataContract]

        public class RoomReservationRequest

        {

            [DataMember]

            public int ReservationId

            {

                get; set;

            }

            [DataMember]

            public int  NoOfRooms

            {

                get; set;

            }

            [DataMember]

            public string TypeOfRoom

            {

                get; set;

            }

            [DataMember]

            public DateTime FromDate

            {

                get; set;

            }

            [DataMember]

            public DateTime ToDate

            {

                get; set;

            }

            [DataMember]

            public string ContactPersonName

            {

                get; set;

            }

            [DataMember]

            public string ContactPersonMail

            {

                get; set;

            }

            [DataMember]

            public string ContactPersonMob

            {

                get; set;

            }

            [DataMember]

            public string Comments

            {

                get; set;

            }

            [DataMember]

            public string Status

            {

                get; set;

            }

        }
    }
     

  12. Add a new class RoomReservationData.cs and write two methods say ReserveRoom and GeReservations

    namespace Practice.WCF
    {
        internal class RoomReservationData
        {
            private string connectionString = ConfigurationManager.ConnectionStrings["con"].ConnectionString;

            internal bool ReserveRoom(RoomReservationRequest roomReservationReq)
            {
                SqlConnection connection = GetConnection();
                string sqlCommand = "INSERT INTO RoomReservationRequest(NoOfRooms, TypeOfRoom, FromDate, ToDate, ContactPersonName, " +
               "ContactPersonMail, ContactPersonMob, Comments, Status) VALUES (" +
                "@NoOfRooms, @TypeOfRoom, @FromDate, @ToDate, @ContactPersonName, " +
               "@ContactPersonMail, @ContactPersonMob, @Comments, @Status)";

                SqlCommand command = connection.CreateCommand();
                command.CommandText = sqlCommand;
                command.Parameters.Add("@NoOfRooms", System.Data.SqlDbType.Int);
                command.Parameters.Add("@TypeOfRoom", System.Data.SqlDbType.NVarChar, 20);
                command.Parameters.Add("@FromDate", System.Data.SqlDbType.DateTime );
                command.Parameters.Add("@ToDate", System.Data.SqlDbType.DateTime);
                command.Parameters.Add("@ContactPersonName", System.Data.SqlDbType.NVarChar, 50);
                command.Parameters.Add("@ContactPersonMail", System.Data.SqlDbType.NVarChar, 50);
                command.Parameters.Add("@ContactPersonMob", System.Data.SqlDbType.NVarChar, 20);
                command.Parameters.Add("@Comments", System.Data.SqlDbType.NVarChar, 200);
                command.Parameters.Add("@Status", System.Data.SqlDbType.NVarChar, 200);

                command.Parameters["@NoOfRooms"].Value = roomReservationReq.NoOfRooms;
                command.Parameters["@TypeOfRoom"].Value = roomReservationReq.TypeOfRoom;
                command.Parameters["@FromDate"].Value = roomReservationReq.FromDate;
                command.Parameters["@ToDate"].Value = roomReservationReq.ToDate;
                command.Parameters["@ContactPersonName"].Value = roomReservationReq.ContactPersonName;
                command.Parameters["@ContactPersonMail"].Value = roomReservationReq.ContactPersonMail;
                command.Parameters["@ContactPersonMob"].Value = roomReservationReq.ContactPersonMob;
                command.Parameters["@Comments"].Value = roomReservationReq.Comments;
                command.Parameters["@Status"].Value = roomReservationReq.Status;

                int rowsEffected =0;
                try
                {
                    rowsEffected = command.ExecuteNonQuery();
                }
                finally
                {
                    if (connection != null)
                    {
                        connection.Close();
                        connection.Dispose();
                    }
                }

                return rowsEffected > 0;
            }

            internal RoomReservationRequest[] GetReservations(DateTime fromDate, DateTime toDate)
            {
                List<RoomReservationRequest> reservedRooms = new List<RoomReservationRequest>();
                SqlConnection connection = GetConnection();
                SqlCommand command = connection.CreateCommand();
               
                command.CommandText = "SELECT ReservationId, NoOfRooms, TypeOfRoom, FromDate" +
                                ",ToDate, ContactPersonName, ContactPersonMail, ContactPersonMob, Comments, Status "+
                                "FROM RoomReservationRequest "+
                                "WHERE FromDate > @FromDate AND ToDate<@ToDate";

                command.Parameters.Add("@FromDate", System.Data.SqlDbType.DateTime);
                command.Parameters.Add("@ToDate", System.Data.SqlDbType.DateTime);

                command.Parameters["@FromDate"].Value = fromDate;
                command.Parameters["@ToDate"].Value = toDate;

                SqlDataReader reader = null;

                try
                {
                    reader = command.ExecuteReader(CommandBehavior.CloseConnection);
                    while (reader.Read())
                    {
           RoomReservationRequest roomReservationRequest = new RoomReservationRequest();
                        roomReservationRequest.ReservationId = Convert.ToInt16(reader[0]);
                        roomReservationRequest.NoOfRooms = Convert.ToInt16(reader[1]);
                        roomReservationRequest.TypeOfRoom = reader[2].ToString();
                        roomReservationRequest.FromDate = Convert.ToDateTime(reader[3]);
                        roomReservationRequest.ToDate = Convert.ToDateTime(reader[4]);
                        roomReservationRequest.ContactPersonName = reader[5].ToString();
                        roomReservationRequest.ContactPersonMail = reader[6].ToString();
                        roomReservationRequest.ContactPersonMob = reader[7].ToString();
                        roomReservationRequest.Comments = reader[8].ToString();
                        roomReservationRequest.Status = reader[9].ToString();
     
                        reservedRooms.Add(roomReservationRequest);               
     }
                }
                finally
                {
                    if (reader != null)
                    {
                        reader.Close();
                        reader.Dispose();
                    }

                    if (connection != null)
                    {
                        connection.Close();
                        connection.Dispose();
                    }
                }
                return reservedRooms.ToArray();

            private SqlConnection GetConnection()
            {
                SqlConnection connection = new SqlConnection(connectionString);
                try
                {
                    connection.Open();
                }
                finally
                {
                }
                return connection;
            }

        }

    }
     

  13. Declare two methods to the interface IService1 say ReserveRoom and GetReservations
     

    namespace Practice.WCF

    {   

        [ServiceContract]

        public interface IService1

        {

            [OperationContract]

            bool ReserveRoom(RoomReservationRequest reservationRequest);

            [OperationContract]

            RoomReservationRequest[] GetReservations(DateTime fromDate, DateTime toDate);

        }

    }
     

  14. Implement the Interface ISErvice1 in Service1.svc.cs class. Create instance of class RoomReservationData which we implemented in Step-12 and use the same into the implemented methods.
     

    namespace Practice.WCF

    {   

        public class Service1 : IService1

        {

            #region IService1 Members

            private RoomReservationData roomReservationData = new RoomReservationData();

            public bool ReserveRoom(RoomReservationRequest reservationRequest)

            {           

                return roomReservationData.ReserveRoom(reservationRequest);

            }

            public RoomReservationRequest[] GetReservations(DateTime fromDate, DateTime toDate)

            {

                return roomReservationData.GetReservations(fromDate, toDate);

            }

            #endregion

        }
    }
     

  15. Now we are done with the implementation of WCF Service. Set the Service1 as Startup page. Run your WCF Application. Should get the following screen.

    WCF8.gif
     
  16. Publish the WCF Service.
    • To publish the service Right Click on Practice.WCF.csproj and select the Publish option

      WCF9.gif
       
    • Enter the location where you need to publish/ host the service.

      WCF10.gif
       
    • Click on Publish button to publish the site.
  17. You may check the published WCF Service by typing the URL into browser
    e.g. http://localhost/wcf/Service1.svc  , a page same as Step-14 will appear.

9. How to Consume the WCF Service?

9.1 Generate the Class and Config File using svcutil.exe


You might have noticed the message displayed while browsing the service

WCF11.gif

Now, we need to generate the classes which our Client Application would use to consume the service.
We may generate the classes/configuration with the help of tool svcutil.exe. Follow the steps to generate the Class/Config file

  • Open the command prompt and Go to the location where svcutil.exe is placed. You may find the same at following place "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin"
  • Write the following command and hit the "enter key" to generate the Class/Config files

    WCF12.gif
     
  • This would generate the Service1.cs and output.config files at the same location where svcutil.exe is placed i.e. "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin"
  • The class generated and the config file we need to include into our client application for consuming the service.

9.2 Create Client to Consume Service

  1. Open Visual Studio
  2. Go to File-> New -> Project
  3. Select Windows Form Application
  4. Create a Form similar to below

    WCF13.gif
     
  5. Include the class generated by Step iii of Section 8.1
  6. Right Click on project and select the option "Add Service Reference" 

    WCF14.gif
     
  7. Enter the URL/ Address where service is hosted and hit on "Go" button to find the service. You may see the Services Methods/Logic exposed by WCF Service

    WCF15.gif
     
  8. Click "OK" to add the service.
  9. Double Click Room Reservation Enquiry button to write the logic. Make sure that you have imported the

    private void btnEnquiry_Click(object sender, EventArgs e)
            {
                Service1Client client = new Service1Client();
                RoomReservationRequest[] reservationEnquiry = null;
                reservationEnquiry = client.GetReservations(dateFromDate.Value, dateToDate.Value);
                if (reservationEnquiry.Length > 0)
                {
                    gvReservationData.DataSource = reservationEnquiry;
                    gvReservationData.Visible = true;
                }
                else
                {
                    gvReservationData.Visible = false;
                    lblMessage.Text = "Sorry data not available.";            
                }

           }
     

  10. When we had added the reference of the Service to the client project one configuration file also would have been added to the application i.e. App.Config. Replace the <system.serviceModel> node of this file by the <system.serviceModel> node of the output.config file generated into "Step- 3" of "Section 7.1"
  11. Run the client application to. Enter From Date, To Date and click Enquiry button to test the application.

10. How to Use the Source?

Unzip the file WCF.zip, you may find the following files

  1. DBBackup.zip
  2. Source.zip

Restore/ Create Database

Unzip the file DBBackup.zip and restore the WCF.bak file to SQL Server Database or you may create the database as suggested in Step 8.1.

Now, Unzip the file Source.zip, you may find

  1. WCFService
  2. WCFClient

Publish/Host Client

  • Open the directory WCFService.
  • Double click Practice.WCF.sln file to open the solution.
  • Modify the web.config file of Service as suggested in Step-7 of Section-8.2.
  • Publish the service as suggested in Step-16 of Section-8.2.

Use WCF Client to consume the services

  • Open WCFClient directory.
  • Double click HelpDeskService.sln file to open the solution.
  • Run the solution.
  • Select the dates and hit on Enquiry button.

Note: You may need to modify App.Config file, if you have not published the WCF Service to local machine.


Login to add your contents and source code to this article
 About the author
 
Ashish Tripathi
This is Ashish Tripathi. I have more than 4 years of experience in IT Industry as developer. Currently working with Proteans Software Solutions, Bangalore as a Senior Software Engineer. I have M.Sc. (Mathematics & Computing) from ISM Dhanbad. 
Technical Exposure : Microsft .NET (Windows and Web Applications), C#, VB.NET, ADO.NET, XML, XSL, VB6, AJAX, ASP.NET Web Services, Windows Communication Foundation (WCF), LINQ, SQL Server, MySql.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
Clickatell's SMS Gateway
Clickatell's Developer Solutions allow you to SMS enable any website or application via a range of API's. Learn More about our API connections.
Free access to .NET Memory Management video
Everything you need to know about Garbage Collection, Temporary Objects, Fragmentation, Finalization and common causes of memory leaks in .NET. Watch the video here.
Microsoft Visual Studio 2010 Professional
Microsoft Visual Studio 2010 Professional will launch on April 12, but you can beat the rush and secure your copy today by pre-ordering at the affordable estimated retail price of $549 (US). Pre-order now.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Developer-Ready ASP.NET 2.0 Web Hosting with 3 MONTHS FREE
Now supporting .NET 3.0 Framework with Windows Workflow Foundation, Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), windows CardSpace (WCS)! Providing more flexibility for Developers with Web Services Support and a User/Permission Manger. Also supporting MS SQL 2005/2000 with Real-Time Backups, FREE Automated Attach .MDF Tool, FREE SQL Restore and Shrink SQL DB Tools, and SQL
 
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
WCF.zip
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
Become a Sponsor
 Comments
Excellent Article, Many Thanks by Grahame On June 17, 2009
As someone just starting to explore WCF, I found your article to be of great help. Thanks again!
Reply | Email | Delete | Modify | 
Missing } in Room ReservationData.cs by Preeti On June 30, 2009
There is a closed bracket missing next to array in the RoomReservationData.cs class
Reply | Email | Delete | Modify | 
Re: Missing } in Room ReservationData.cs by Ashish On July 1, 2009
Thanks. I will correct the same soon.
Reply | Email | Delete | Modify | 
Re: Re: Missing } in Room ReservationData.cs by Dhananjay On July 11, 2009
Nice one 
Reply | Email | Delete | Modify | 
Very nice article by Ram On July 13, 2009

looks very informative and helpful :) -thanks

Reply | Email | Delete | Modify | 
Problem - Publishing to Vista / IIS 7.0 by Abul On July 13, 2009
Service running locally without publishing.. gives error 404.17 NOT FOUND when I publish it on my local IIS. here is the problem detail (Copied from the error page):

" HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.


Most likely causes:

The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try:

If you want to serve this content as a static file, add an explicit MIME map."


Regards,

Abul Hasan Lakhani.
MCPD - Web Developer
Reply | Email | Delete | Modify | 
Great Introduction. by Jorge L On July 17, 2009
If it is possible I think would be great if some example of comunication with another architecture (said J2EE) is provided here just to reflect the power on cross-architecture of WCF. 

Thanks for the article.
Reply | Email | Delete | Modify | 
Keep Writing! by William On August 6, 2009
Wonderful article -- keep writing!!!!  I'll be back
Reply | Email | Delete | Modify | 
Wonderful by prabhat On September 6, 2009
Excellent
Reply | Email | Delete | Modify | 
hi by ashish On September 11, 2009
its great artical about WCF
Reply | Email | Delete | Modify | 
Really nice article by Lalithashankar On September 14, 2009
Thanks Ashish ,

Really this is a nice article, any body who knows basic .net can understand the concept.

thanks and regards
shankar.
Reply | Email | Delete | Modify | 
Very Good article... by rupali On September 22, 2009
Very Informative....
Reply | Email | Delete | Modify | 
Re: Very Good article... by Prince On October 14, 2009
Very good article. Thanks.
Reply | Email | Delete | Modify | 
Getting error while running above code by Ajay On October 23, 2009
Could not find default endpoint element that references contract 'ServiceReference1.IService1' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
Reply | Email | Delete | Modify | 
Good Article by Manish On November 3, 2009
Very informative article.

Keep writing!
Reply | Email | Delete | Modify | 
loud and clear! by kurt On November 18, 2009
      
Ashish Tripathi
Ashish, thanks for this very informative , useful and clear tutorial. I really appriciate it especially I'm a new in WCF. I hope to see more post from you regarding to this topic (WCF).
Ashish Tripathi
Reply | Email | Delete | Modify | 
i am getting this error while runing application by ajay On November 22, 2009

System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

 

Server stack trace:

   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)

   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

 

Exception rethrown at [0]:

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at IService1.GetReservations(DateTime fromDate, DateTime toDate)

   at Service1Client.GetReservations(DateTime fromDate, DateTime toDate) in C:\Documents and Settings\Ajay\Desktop\WCF\Source\WCFClient\Service1.cs:line 242

   at HelpDeskService.HelpDesk.btnEnquiry_Click(Object sender, EventArgs e) in C:\Documents and Settings\Ajay\Desktop\WCF\Source\WCFClient\HelpDesk.cs:line 30

Reply | Email | Delete | Modify | 
Re: i am getting this error while runing application by Ashish On November 24, 2009
Hello Ajay,
Please let me know the OS and Visual Studio Version which you are using. Sorry for the inconvenience.
I will try to rectify the issue reported by you.
With best wishes...

Ashish Tripathi
Reply | Email | Delete | Modify | 
Re: Re: i am getting this error while runing application by ajay On November 26, 2009
i am using visual studio 2008 with service pack 1 and operating system is windows xp professional with service pack 3 .by the way you have tried best tutorial i believe.but i want wcf service with multiple end points.as well as i need different appdomain runing services example .i mean that suppose one process is runing in default appdomain and this process holds mainy appdomain and each appdomain holds dll (assembly).i want to make sure that anything happens (like any exception or error ) in one appdomain it should be known by other appdomain as well as default appdomain.whole idea is here i want to make sure appdomain cross communication using wcf as well as want to use refelection for knowing detail of particular assembly which is loaded in particular appdomain at run time  .how i can do it?do you have any idea or any other tutorial you can suggest me.
Reply | Email | Delete | Modify | 
Greate Article by Amit On December 25, 2009
This is a great article for fresher as well experience persons, those are not familiar with
Windows Communication Foundation.
                                                   Thanks.
Reply | Email | Delete | Modify | 
Greate Article by Prasad On January 5, 2010
Very nice artical. It helps me lot.
Reply | Email | Delete | Modify | 
An Introduction to Windows Communication Foundation (WCF) by Harbans On January 28, 2010
Very informative, very clear and concise - Thank you so much
Reply | Email | Delete | Modify | 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 2010  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.