无法激活 WCF 服务 [英] Can't Activate WCF service

查看:26
本文介绍了无法激活 WCF 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WCF,它在本地主机上运行良好.我把它放在生产服务器上后,它抛出一个异常

I'm working over WCF and it worked fine on localhost. After I placed it on the production server, it thows an exception

请求的服务,'http://global-kazway.kz/Service1.svc' 可以不被激活.有关更多信息,请参阅服务器的诊断跟踪日志信息

The requested service, 'http://global-kazway.kz/Service1.svc' could not be activated. See the server's diagnostic trace logs for more information

我是服务领域的新手,我已经尝试解决这个问题将近 3 个小时了.

I'm new in Services and have been trying to solve this problem for almost 3 hours.

这里是客户端的App.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections></configSections>
  <connectionStrings>
    <add name="TestProject.Properties.Settings.DBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\1\Documents\visual studio 2010\Projects\TestProject\TestProject\AppData\DB.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /><add name="DBEntities" connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=C:\Users\1\Documents\visual studio 2010\Projects\TestProject\TestProject\AppData\DB.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /><add name="DBEntities1" connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\AppData\DB.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://global-kazway.kz/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService1" contract="kazwayServiceReference.IService1"
        name="BasicHttpBinding_IService1" />
    </client>
  </system.serviceModel>
</configuration>

推荐答案

排除 WCF 应用程序故障的第一步是打开浏览器并输入服务 URI.因此,基于客户端:您将导航到 http://global-kazway.kz/Service1.svc

First step in troubleshooting a WCF application is to bring up a browser and type in the service URI. So based on the client: you'd navigate to http://global-kazway.kz/Service1.svc

现在看看你得到什么样的结果.例外?服务画面?通常你可以从这个屏幕上获得最好的信息!有时它会指出您的问题是什么,例如缺少行为.

Now see what kind of results you get. Exception? The service screen? Usually you can get your best information from this screen! Sometimes it points out what your issue is such as missing a behavior.

将您的 web.config 与部署的 web.config 条目进行比较.你也可以在那里找到一些东西.最后,您可能只需要管理文件夹的安全性.但是浏览器显示可以非常清楚地为您说明一切.

Compare your web.config with the deployed web.config entries. You may find something there as well. Finally you may just have to manage security on your folder. But the browser display could spell everything out for you very clearly.

这篇关于无法激活 WCF 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆