询问WCF服务

时间:2018-05-17 13:10:05

标签: c# asp.net silverlight

我在界面和wcf服务类中更改了命名空间的名称,现在当我将此服务添加到我的项目时,我遇到了这个错误:

There was an error downloading 
'http://localhost:23724/DataAccess/Customer.svc/$metadata'.
The request failed with the error message:
--
<!DOCTYPE html>
<html>
 <head>
     <title>The type 'CoffeShop.Web.Business.Customer', provided as the 
 Service attribute value in the ServiceHost directive, or provided in the 
configuration element 
system.serviceModel/serviceHostingEnvironment/serviceActivations could not be 
found.</title>

&#13;
&#13;
<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5.2" />
   
    </system.web>

    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="false"
            multipleSiteBindingsEnabled="true"/>
    </system.serviceModel>
  <connectionStrings>
    <add name="myDB" connectionString="Data Source=HAJI\HAJISQL;Initial Catalog=CoffeShop;Integrated Security=True"/>
  </connectionStrings>
  
</configuration>
&#13;
&#13;
&#13;

我的webconfig。 请帮忙。

&#13;
&#13;
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IProduct" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                    <security mode="None" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
          
            <endpoint address="../DataAccess/Product.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IProduct" contract="ProductService.IProduct"
                name="BasicHttpBinding_IProduct" />
        </client>
    </system.serviceModel>
</configuration>
&#13;
&#13;
&#13;

ServiceReferences.ClientConfig已共享。 请帮帮我。

0 个答案:

没有答案