0

私は wcf サービスを持っていますが、次のエラーが表示されます。

ServiceMetadataBehavior の HttpsGetEnabled プロパティは true に設定され、HttpsGetUrl プロパティは相対アドレスですが、https ベース アドレスはありません。https ベース アドレスを指定するか、HttpsGetUrl を絶対アドレスに設定します。

私の web.config 設定は次のとおりです。

<system.serviceModel>
<services>
  <service name="TBServiceProvider" behaviorConfiguration="ServiceBehaviour">
    <endpoint address="" binding="webHttpBinding"
              contract="ITBServiceProvider" behaviorConfiguration="web">
    </endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehaviour">
      <serviceMetadata httpsGetEnabled="false"/>
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled="true" >
  <baseAddressPrefixFilters>
    <add prefix="http://www.xyz.com:8000"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

上記の設定は localhost では問題なく機能しますが、サーバーにアップロードすると上記のエラーが発生します。ホスティング サーバーでサービスを動作させるにはどうすればよいか教えてください。

ありがとう

4

2 に答える 2

0

web.config ファイルの更新

 <system.serviceModel>
 <behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="Web">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <webHttpBinding>
    <binding>
      <security mode="None" />
    </binding>
  </webHttpBinding>
</bindings>
<services>
  <service name="TBSERVICe">
    <endpoint address=""
              binding="webHttpBinding"
              behaviorConfiguration="Web"
              contract="ITBSERVICE" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

TBSERVICE.svc ファイルへの追加

    Factory="System.ServiceModel.Activation.WebServiceHostFactory"

これらの設定は、サーバーで Web サービスをホストする場合にうまく機能しました。私の問題は、ファイルに変更が加えられたときにファイルが更新されないことに関するものでもありました。つまり、.svc や web.config などのプロジェクト ファイルは、ホスティング サーバーによって一時ストレージから引き続き受け入れられました。その場合、常に少なくとも 2 つのサーバーに配置することをお勧めします。

ありがとう

于 2013-10-17T05:33:11.877 に答える
0

IIS では、ベース アドレス プレフィックスは必要ありません。このパラメータは削除できます。

次に、httpsGetEnabled を httpGetEnabled に置き換える必要があります。TLS でサービスを公開しない場合は、httpsGetEnabled を指定する必要はありません。

最後に、サーバーとリモート コンピューターの Internet Explorer に表示されるサービスのスクリーンショットを追加できますか。

于 2013-10-15T07:26:39.657 に答える