Click here to Skip to main content
15,894,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
When I create WCF service and when I add reference service
This message appear ( an error occurred while attempting to find services)
and in details is say make sure about your metadata
My web Config is:
XML
<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

and my CS file is

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace MService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IMService
    {
        [OperationContract]
        string GetTime(int timeStrength);
    }
}



I do not understand the problem
There are anyone know and help please

Thanks
Best regards
Noor
Posted
Updated 3-Oct-11 6:17am
v2
Comments
Bala Selvanayagam 3-Oct-11 12:06pm    
how do you add the reference to the client ? GO/ DISCOVER


1.Paste the service URL and click 'GO' on the 'Add Service Reference' screen
2.Paste the service URL and click 'DISCOVER' on the 'Add Service Reference' screen


Also, are you trying to do from the same machine or different machine ?
Noor2011 3-Oct-11 12:48pm    
Bala thank you
but my problem is when I press right click on my service name to add service reference I press discover and I show URL but when I click OK it's show massege ( “An error (Details) occurred while attempting to find services)
the same in this picture:
http://johnwsaunders3.files.wordpress.com/2009/05/423a0a59b7a4bb1943d9d379a535ccc3.png
Thank you once again

Bala Selvanayagam 3-Oct-11 13:18pm    
Few more clarification pl

Web service hosted in IIS ?

If not you can try hosting in IIS and call the hosted URL ?
If hosted, make sure you can access the webserice via the browser

let me know what happens

I think there is an error in your WCF service. Try building the WCF service first and check if there are errors then fix it. Once you are able to compile your WCF service without an error, then you can try adding the service reference.
 
Share this answer
 
It Looks like you have only defined a service behavior not the service, endpoint in the web.config.

a helpful tool to manage this config is in VS2010 goto

>> Tools | WCF Service Configuration Editor

that will open a nice little manager app to help you with your web.config
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900