Click here to Skip to main content
13,665,554 members
Rate this:
 
Please Sign up or sign in to vote.
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 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

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 3-Oct-11 5:56am
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180810.1 | Last Updated 6 Oct 2011
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100