使用远程客户端时WCF错误零应用程序端点

时间:2013-11-14 18:14:20

标签: c# wcf web-config

我发布的WCF服务运行正常,并通过拉出wsdl进行验证?屏幕。

但是,当我尝试使用来自单独网站的代码访问任何方法时,我收到以下错误:

  

服务'wcfServiceFromCaps.AgentWebAppServiceClient'具有零应用程序(非基础架构)端点。这可能是因为没有为您的应用程序找到配置文件

[ServiceContract]
interface IAgentWebAppService
{

[OperationContract]
[FaultContract(typeof(ServiceData))]
void DoWork();

[OperationContract]
[FaultContract(typeof(ServiceData))]
String GetAgentPicURLUsingStation(string station);

}

客户端WebConfig

    <configuration>
    <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IAgentWebAppService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://myfulladdresshere:87/AgentWebAppService.svc"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAgentWebAppService"
          contract="IAgentWebAppService" name="WSHttpBinding_IAgentWebAppService">
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

客户端CS

AgentWebAppServiceClient newWcf = new AgentWebAppServiceClient();

            try
            {

                string newstring = newWcf.GetAgentPicURLUsingStation(this.Phone);
                newpicurl = newstring;
            }
            catch (FaultException<wcfServiceFromCaps.ServiceData> Fex)
            { 
                 ....
            }

我错过了什么?

更新! * 的*

我通过清理所有内容并从头开始重新创建来解决它。 现在我收到以下消息:

  

无法打开登录请求的数据库“dbname”。登录   失败。用户“Servername $”

登录失败

0 个答案:

没有答案