私のwinformsアプリケーションにサービス参照を追加しようとすると問題が発生します。サービスとアプリケーションの両方が同じソリューションにあり、サービスはデフォルトのiisexpress開発証明書がインストールされたiisexpressを使用しています。サービス参照を追加しようとすると、通常のダイアログが表示され、サービスを見つけて、証明書に権限がないことを伝えます。私はそのメッセージを「OK」しますが、このエラーが発生します。WCFサービス参照を追加すると、クライアント認証スキーム '匿名'エラーでHTTP要求が禁止されました
クライアント認証方式 '匿名'でHTTPリクエストを禁止しました。
<appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> <authentication mode="Windows" /> <identity impersonate="false" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the values below to false before deployment --> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="WsHttpBindingConfig"> <security mode="TransportWithMessageCredential"> <transport clientCredentialType="Certificate" /> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings> <protocolMapping> <add binding="wsHttpBinding" scheme="https" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <!-- To browse web app root directory during debugging, set the value below to true. Set to false before deployment to avoid disclosing web app folder information. --> <directoryBrowse enabled="true" /> </system.webServer> </configuration>
EDIT ----------------
を次のようにWebサービスのweb.configがある
証明書を受け入れると、次のメッセージボックスが表示されます。
は私が
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
に
<protocolMapping>
<add binding="wsHttpsBinding" scheme="https" />
</protocolMapping>
を変更した場合、私が発見した。また
「あなたは有効なアドレスが入力されていることを確認し、このaddress.Pleaseからメタデータをダウンロード中にエラーがありました」
それから私は突然参照を追加することができます。どうしてこれなの?確かに私はそれがwsHttpsBindingである必要がありますか?
にサーバー
で次の設定を変更する必要が
私は再び参照を追加しようとした後、再構築なしにclientCredentialTypeを変更しました。しかし、私は同じエラーを取得します。 – coolblue2000
' 'も削除する必要があります。安全であるように、 ''を ''に変更してください。 –
rae1
どのようにして資格情報を使用してWebサービスにサインインしますか? – coolblue2000