0

公開された WCF サービスが正しく実行されており、wsdl をプルアップして検証していますか? 画面。

ただし、別の Web サイトのコードを使用してメソッドにアクセスしようとすると、次のエラーが発生します。

サービス「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$」のログインに失敗しました

4

0 に答える 0