.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WCF Service not working

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF
Hi Everyone,

I am a new bee in field of WCF. I am using Windows Server 2003 service pac 2 machine with VS 2008 for development.

I was trying to develop an 3-tier architecture and this time wanted to exploit WCF services instead of asmx...

1) I created service, by creating interface and class. ( Note that I am using self hosted technique).
2) I took Service refrence in my Proxy class, and VS 2008 generated Proxy class and app.config for me.

here is my config file in Service solution

      <service name="SampleT3.BusinessServices.UserBusinessService" behaviorConfiguration="ServiceBehavior">
        <!-- Service Endpoints -->
        <endpoint address="" binding="wsHttpBinding" contract="SampleT3.BusinessServices.IUserBusinessService">
              Upon deployment, the following identity element should be removed or replaced to reflect the
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
            <dns value="localhost"/>

View Complete Post

More Related Resource Links

Foundations: Working With The .NET Service Bus


The .NET Services Bus is arguably the most accessible, powerful, and useful piece of the new Windows Azure Cloud Computing initiative. See how it manages cloud communications.

Juval Lowy

MSDN Magazine April 2009

WCF Service not working with ToolkitScriptManager

Back in the "old days" one would use the <asp:ScriptManager></asp:ScriptManager> and <asp:ServiceReferenc /> to allow for WCF Service integration into javascript on web forms.  Example: <asp:ScriptManager ID="ScriptManager1" runat="server">     <Services>         <asp:ServiceReference Path="~/Services/Service1.svc" />     </Services> </asp:ScriptManager> Now we are to use the <AjaxControlToolkit:ToolkitScriptManager></AjaxControlToolkit:ToolkitScriptManager> to accomplish the same task, but this doesn't seem to be working. Example: <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">     <Services>        <asp:ServiceReference Path="~/Services/Service1.svc" />     </Services> </AjaxControlToolkit:ToolkitScriptManager> The former works. while the latter does not. Any suggestions? Visual Studio 2008 Professional .Net Framework 3.5 AJAX Toolkit 3.5.40412.0<asp:ScriptManager ID="ScriptManager1" runat="server">    <Services>        <asp:ServiceReference Path="~/Services/Service1.svc" />&nb

Sharepoint Search and Secure Store Service not working

Hi There I am having issues with a few Sharepoint Services When I try to search for a document on any SharePoint site, I recieve an "Internal Server Error Exception". However when I checked the log files, I couldn't find any error messages matching with the given correlation ID. The search was working 2-3 weeks ago. Also 2 weeks ago, I started receiving warnings in the Health Analyzer saying “The Security token service is not available”. I am wondering if the security token service breaking down is related to the search issues, and if so what suggestions I could try to fix this issue. I am also unable to access the secure store service. In Central Administration->Application Management->Manage Service Applications, I try to click on the Secure Store Service, but there is no Proxy attached to the service, and I receive a message “No Secure Store Service Application Proxy ID was found”. When I check the Logfile, I receive these errors: 08/10/2010 11:11:32.94               w3wp.exe (0x18E4)                                      0x0ADC SharePoint Foundation     &nb

WCF Routing service with Backup List not working with MSMQ

Hi I developed routing service for round robin routing. I added backup lists to this routing service in round robin pattern in config file. My configuration is as below. <services>       <service behaviorConfiguration="routingConfiguration" name="System.ServiceModel.Routing.RoutingService">         <host>           <baseAddresses>             <add baseAddress="net.tcp://localhost/FDPRoutingService/router"/>           </baseAddresses>         </host>         <!--Set up the inbound endpoints for the Routing Service-->         <!--first create the general router endpoint-->         <endpoint address="" binding="netTcpBinding"                   name="NetTcpBinding_IFDService" contract="System.ServiceModel.Routing.ISimplexDatagramRouter"/>       </service>     </services>  &nbs

WPF consuming WCF Service with Windows Authentication - Not Working

Hi I am developing a WPF application in .NET 4.0 which calls a WCF Service hosted on the server developed in .NET 4.0. I want to use windows authentication for this purpose and it seems that it is not working and keep on giving me following error. The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via I do not want to use https as this is an Intranet application. The WCF Service inturn calls SQL Server SPs via Entity Framwork 4.0. Following is the Web.Config for WCF Service. <?xml version="1.0"?> <configuration> <connectionStrings> <add name="MsdbEntities" connectionString="metadata=res://*/MsdbModel.csdl|res://*/MsdbModel.ssdl|res://*/MsdbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=lvapxdev\lvw_uat_02;Initial Catalog=msdb;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="IndexLoaderInstallDirectory" value="D:\Longview\Index Loader\"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"/> <authentication mode="Windows"></authentication> </syst

What service is responsible for Calendar Overlay working correctly?

I'm having 2 issues with my SharePoint server.  User Profile Sync stuck on starting and Calendar Overlay not working. I created a calendar overlay a month ago, containing 7 other calendars and it works fine.  It currently still works if I add items to one of the 7 calendars, those items show up on the calendar with the overaly. But if I try and create a new calendar and add overlay to it - containing different calendars, nothing appears.   No calendar items from the overlay calendars that I've added. This has only started happening since my User Profile Sync stopped working - are the two related, somehow? I get no errors at all - just a blank calendar!  Frustrating!! Thanks for any help.  

web service is not working on production server

hi i am calling the webservice from acrobat javascript. it works very well in development server. but when i put the same code in production server, it doesnt call the webservice. And doesn't throw any error. Help me .

Not able to generate proxy for the service hosted on IIS, but working on Dev Web Server?

Hi, I have tried to host WCF on the IIS, it browsed sucessfully using the path http://localhost/WCF/Service1.svc but when tried to generate proxy using SvcUtil, it generated the following message. Bus the same when tried from the development server is working file. c:\Program Files\Microsoft Visual Studio 9.0\VC>svcutil.exe http://localhost/WCF /Service1.svc?wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved. Attempting to download metadata from 'http://localhost/WCF/Service1.svc?wsdl' us ing WS-Metadata Exchange or DISCO. Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved. Error: Cannot obtain Metadata from http://localhost/WCF/Service1.svc?wsdl If this is a Windows (R) Communication Foundation service to which you have acce ss, please check that you have enabled metadata publishing at the specified addr ess.  For help enabling metadata publishing, please refer to the MSDN documentat ion at http://go.microsoft.com/fwlink/?LinkId=65455. WS-Metadata Exchange Error     URI: http://localhost/WCF/Service1.svc?wsdl     Metadata contains a reference that cannot be resolved: 'http:

Web Service Call Not Working


So I'm still not sure if this is on my side, the service side, or both sides. I have NO idea where the main source of the issue is coming from, but I will try and do my best to explain the steps I have taken and what has happened so far so you guys have all the info you need to bang your head against this with me.

So we have a Web Service class called API.svc that implements one of our classes containing one method. In the API class is where the call goes out to the service, however it seems to be failing before that so I think that the problem is coming locally. Note I said I THINK.

The first time we ran into an error was running the code normally, and testing this after not testing it in a while. The error that came back when we clicked the button that ran through all the calls (eventually needing to hit the service call), was this:

System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose v

Web Service Master Detailsview - SelectedIndexChanging not working


I have a web service that binds data to a gridview.  I am trying to use a detailsview to select a row and make some changes.  My issue is, I am not using the datakeynames, which is not being used to bind data to the gridview.  That is being done through a datatable and dataview.  I tried to bind my detailsview to a table and defaultview, which works.  But the problem is, it is selecting a default row.  I am unable to select any other row besides the first row.  I can't bind the detailsview datasource property to the objectdatasource or sqldatasource objects, which seems to be all I can find online.  I need to be able to bind to a datasource(i.e. datatable, defaultview), which I am able to bind to it, but the detailsview isn't displaying any other record besides first row/record from my gridview.  I am unable to use the datakeynames, which would not be an issue if I were using sql or any other database, but I am unable to retrieve it, set it or use it, using a web service.  Any help would be greatly appreciated! This is a sample of my code below for the GridView SelectedIndexChanging event:

protected void grdOpenTickets_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)


WebService.GetListOutput[] recordList;

string strQuery = "'Create Date' > \"9/1

Search service no longer working. :(


I stuffed up my installation of SP 2010 by first installing MS Project 2010 onto the server.  I then removed the application, this is where my problems began.  After removing my entire SP sites would not work.  I figured I had to reinstall MS Project 2010 to get the SP Admin config wizard to work correctly.  My sites then came back online. :)  But now I find my searching is not working.

I am getting the following errors

The search application 'Search Service Application' on server <SERVERNAME> did not finish loading. View the event logs on the affected server for more information

In the event log

 Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (65a62f7e-3894-4ef8-baab-e5f699b7196a). Reason: The device is not ready. Technical Support Details: System.IO.FileNotFoundException: The device is not ready. at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize() at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)


Any ideas?

WCF Service call from another WCF Service not working


We have a requirement to call a WCF service from another WCF Service. To test this I build a sample console application to display a simple string. The setup is: Console App -> WCF Service 1 -> WCF Service 2 Console App calls a method of service 1 and the service 1 method eventually calls service 2 method to return a string. I am able to call Console -> Service 1 but Service 1 -> Service 2 is not working. It throws an exception: "Could not find default endpoint element that references contract 'ITestService2' 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." To accomplish this,
1. I have created a service2, compiled and then created a proxy class and app.config. 2. I created service1, copied service2.cs(proxy) and app.config, created an object of service2 and called service2's menthod.
3. I created a console application, copied the service1.cs (proxy) and app.config, called service1's method.

Do I need to specify any link in app.config of service1 to service2? but how?

the app.config files for service1 and service2 are:


Web Service Error while working on different webapplications


Hi All ,

I created a sharepoint webserives to fetch ListCollection under a given site ,when I try this with sites in the same webapplication where it is hosted it is working fine ,where as when I try it with sites under a different webapplication on the same farm it resulting into error , asny body suggest as how to go about the same .


<?xml version="1.0" encoding="utf-8"?><soap:Envelope smlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope"><soap:Body><GetListCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/"/><soap:Body></soap:Envelope>





SSP not working after Reporting Service Add-in Removal


I have a mess.  Back in August I installed the Reporting Services Add-in for SharePoint on my MOSS 2007 server.  I had some trouble getting it installed and never ended up getting it to work.  So I uninstalled it - which at the time looked like it uninstalled fine, however, I found out later that search wasn't working.  I tried resolving but decided I should probably do a restart.  After that none of the sites came up at all.  We performed a SharePoint Restore to a time before I installed the add-in (1 day earlier)  (We use Backup Exec.)  After that, the webs would come up but my SSP came up in an unprovisioning status.

At the time I didn't think it was any big deal, just Create a new SSP and reindex your content.  Well, the first SSP I tried to create, did create but when I try to configure anything on it I get an Access Denied Error.

I researched my Application Log, fixed issues in my Web.Config files where it was still looking for the Reporting Services Add-in.  (Not sure why Backup Exec Restore didn't fix this.) Restarted the Server.

Tried to create another SSP, got errors when I created it as well, tried to delete it - it is stuck in an "unprovisioning" state as well.  (I have no idea why the first one is "unprovisioning" other than it didn't like being restored.)<

Debug WCF Service hosted on local IIS not working


I have one solution WCFSampleSolution and it has all my projects - Web Service, Client and Website. The structure is something like:

 + WCFSampleSolution
    - C:\WCFSample\Website
    - WCFService
    - WCFWebClient

I created WCFService project for my services. It contains IService1.cs and Service1.cs. Then I hosted the service in IIS. I did this by creating a website and adding .svc and web.config files to the website project. Then published it in IIS. When I run http:\\MyMachineName\Website\Service.svc, it shows the service description. Then I create the web client that calls the webservice. I used the service reference to add the service. It calls a method of Service1. It works fine. But I amnot able to debug this program/setup. I verified the config files in WCFWebClient project and Website project and they have proper debug settings.

<compilation debug="true">


I put break points but control never goes to my seb service. I also tried attach process, but it also doesn't work. But I was able to debug one of my other WCF projects. The setup was little different. In that project I copied the .svc file and config in my web client and the debug works fine.

Please HELP!!

'Add Service Reference' not working for multiple include statements


I'm using VS 2010 (.NET 4.0) and I cannot use 'Add Service Reference' to generate my .NET proxy client since looks like using 'Add Service Reference' (svcutil.exe) option doesn’t work if there are multiple include statements for the schemas in the wsdl. Using "Add Web Reference" (wsdl.exe) option does work to consume this kind of wsdl but having issues passing UsernameToken.

My understanding is it generates WCF client only if 'Add Service Reference' option is used and not 'Add Web Reference'.

The web service is from the 3rd party, so I cannot modify it and they expect UsernameToken in the SOAP header.

Here’s the url to get the package that co

Web service not working after hosting


Hi all, I made a web service..and called it by javascript from my aspx page.

It worked fine on local system, but when I hosted it to the deployment server, it never worked there. I have checked the NameSpace, its same in client script and the web service.

I am new to XML web services so please can anyone help me getting it work?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend