WCFサービスを作成し、IIS(5.1)でサービスをホストしました。
私はbasicHttpbindingを使用し、wsHttpBinding.Follwoingはバインディングの構成宣言です。
<service name="ServiceLibarary.DummyService" behaviorConfiguration="mexHttp">
<endpoint address="Soap11" binding="basicHttpBinding" contract="ServiceLibarary.IService" bindingConfiguration="basicHttp"/>
<endpoint address="Soap12" binding="wsHttpBinding" contract="ServiceLibarary.IService" bindingConfiguration="wsHttp"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
およびそれぞれのバインディング構成
<bindings>
<basicHttpBinding>
<binding name="basicHttp">
<readerQuotas/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttp">
<security mode="None">
<message clientCredentialType="None" />
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
クライアントとしてASP.MVCWebアプリを作成しました。プロジェクトにLinq-to-SqlクラスがありService
ます。問題は、クライアント(MVCアプリ)を実行していて、ログインに接続すると、次のようになります。
ログインで要求されたデータベース「WCF」を開くことができません。ログインに失敗しました。ユーザーエラーのためログインに失敗しました。
WCF
データベースの名前はどこにありますか。
基本的なバインディングを使用して、クライアントでプロキシクラスを初期化しています。
同じソリューションからサービス参照を追加する場合、つまりWCFサービスビルド(MVCアプリと同じ)のソリューションからサービス参照を取得する場合、正常に機能しています。以下は私が持っているconnectionStringです
<connectionStrings>
<add name="ServiceLibarary.Properties.Settings.WCFConnectionString"
connectionString="Data Source=localhost;Initial Catalog=WCF;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
WindowsXPと.NET3.5を使用しています。なぜそれが起こっているのか考えていますか?私は何かが足りないのですか。