2011-01-04 3 views
2

私はwsHttpBindingでサービスを作成しましたが、サービスをダウンロードするたびにクライアントの設定にbasichttpbindingが作成されます。なぜどんなアイデア? thanskwsHttpBindingが基本的なhttpBindingに戻りました

<system.serviceModel> 
    <serviceHostingEnvironment/> 
    <bindings> 

     <wsHttpBinding> 
     <binding name="WSHttpBinding" sendTimeout="00:10:00" receiveTimeout="00:59:00" bypassProxyOnLocal="false" 
     transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000" 
     messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true" 
     allowCookies="false"> 
      <readerQuotas maxDepth="32" maxStringContentLength="50000000" 
      maxArrayLength="50000000" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> 
      <reliableSession inactivityTimeout="00:59:00" /> 
      <security mode="Message"> 
      <!--<transport clientCredentialType="Windows" proxyCredentialType="None" 
     realm="" />--> 
      <message clientCredentialType="UserName" negotiateServiceCredential="true" 
      algorithmSuite="Default" establishSecurityContext="true" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 

    <services> 
     <service behaviorConfiguration="AdviserPayServiceBehaviour" name="AdviserPay.Services.FirstService.FirstService"> 
     <endpoint binding="wsHttpBinding" bindingConfiguration="WSHttpBinding" contract="AdviserPay.Services.FirstService.IFirstService" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior name="AdviserPayServiceBehaviour"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
      <serviceAuthorization principalPermissionMode="None" impersonateCallerForAllOperations="false" /> 
      <serviceCredentials> 
      <userNameAuthentication userNamePasswordValidationMode="Custom" 
       membershipProviderName="AdviserPayCustomMembershipProvider" /> 
      </serviceCredentials> 
      <serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="false" 
      serviceAuthorizationAuditLevel="None" messageAuthenticationAuditLevel="SuccessOrFailure" /> 
      <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" /> 
     </behavior> 
     <behavior name=""> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
+0

はい。これはで始まり、で終わります。 – user384080

+0

サービスが動作していて、設定を使用していますか?メッセージセキュリティを設定しても、その証明書を設定していないため、このメッセージは表示されません。ブラウザでサービスのWSDLを開いたときに何が表示されますか?セキュリティアサーションがありますか? –

答えて

5

それは.SVCマークアップファイル内のサービス名は、web.configファイルで指定された名前と一致しないことが考えられます。

WCFがサービスを開始すると、フレームワークは.svcファイルのサービス名をチェックし、web.configでその名前に一致する構成を探します。何も見つからない場合は、デフォルトの設定 - BasicHttpBindingを使用します。 FirstService.svcに

  • クリックし

    1. 右クリックし「表示マークアップ」
    2. サービス属性は、web.configファイル内のサービス名属性と一致していることを確認します。

      はあなたの問題を解決するには。
  • +0

    それは試してみましたが運がいい... – user384080

    +0

    web.configの設定がロードされていないことは確かです。FirstService.svcの内容を投稿できますか? –

    +0

    ありがとうございます。私は全く同じ問題を抱えていましたが、実際にはsvcファイルとweb.configの間のサービス名の不一致でした – Maverik

    1

    私は同じ問題がありますが、私のサービスはうまくいきます。私の場合、basichttpとwshttpの2つのバインディングが公開されています。私は.net 3.5で新たに作成されたテスト用Webサイトを持っています。サービス参照を取得すると、両方のバインディングが取り除かれ、基本的なエンドポイントがコメントアウトされます。 それはすべて動作します。

    しかし、 実際のコンシューマは、.net 2.0でオリジナルで作成されたWebサイトで、4.0以降にアップグレードされています。だから私は前と同じプロセスを、basicHttpエンドポイントをコメントアウトします。しかし、サービスを呼び出すときに例外が発生し、httpを送受信することを期待している場合、サーバーはこのテストで接続を拒否します。

    これは、サイトが4.0にアップグレードされていて、元々3.5以上で作成されていないものでなければなりません。私はこれがアップグレード状況であると言うことができます。なぜなら、通常存在するプロパティフォルダは実際のサービスコンシューマサイトに存在しないからです。

    オンにするフラグ/設定が必要ですが、わかりません。

    関連する問題