2

ADO.NET iSeries ドライバーを使用して、ac# アプリケーションで IBM.Iseries データベースに接続しています。私のWCFサービスはエラーをスローしています

「 TCP ポート 80 が別のアプリケーションによって使用されているため、HTTP は URL http://+:80/Temporary_Listen_Addresses/771be107-8fa3-46f9-ac01-12c4d503d01e/を登録できませんでした。」

 <system.serviceModel>
<client>
  <endpoint address="http://localhost:8080/Design_Time_Addresses/DataAccessLayer/POEngine/"
    binding="wsDualHttpBinding"  bindingConfiguration="" contract="POServiceReference.IPOEngine"
    name="MyPoBindings">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
  <endpoint address="http://localhost:8080/Design_Time_Addresses/DataAccessLayer/POEngine/"
    binding="wsDualHttpBinding" bindingConfiguration="PoBindings1"
    contract="POServiceReference.IPOEngine" name="PoBindings">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
</client>
<bindings>
  <wsDualHttpBinding>
    <binding name="PoBindings1" 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">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" />
      <security mode="Message">
        <message clientCredentialType="Windows" negotiateServiceCredential="true"
          algorithmSuite="Default" />
      </security>
    </binding>
  </wsDualHttpBinding>
  <wsHttpBinding>
    <binding name="PoBindings" />
  </wsHttpBinding>
</bindings>
<services>
  <service behaviorConfiguration="DataAccessLayer.POEngineBehavior"
    name="DataAccessLayer.POEngine">
    <endpoint address="" binding="wsDualHttpBinding" bindingConfiguration=""
      name="PoBindings" contract="DataAccessLayer.IPOEngine">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8080/Design_Time_Addresses/DataAccessLayer/POEngine/" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="NewBehavior" />
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="DataAccessLayer.Service1Behavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    <behavior name="DataAccessLayer.POEngineBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>  </system.serviceModel>

IBMデータアクセスを使用せずに問題を抱えています。通常の Hello World でもエラーがスローされます。ポート アドレスを変更する必要がある場合

4

1 に答える 1

1

「問題」は、デュプレックスコントラクト(サーバーがクライアントにコールバックする)を対象としたwsDualHttpBindingを使用していることです。この機能が必要ですか?その場合clientBaseAddress、バインディング構成でを指定して、クライアントがリッスンするアドレスを指定する必要があります。さらに、PoBindings1バインディング構成を使用するようにエンドポイントに指示する必要があります。

WCFは、一意のエンドポイントアドレスを生成するために、ベースアドレスにGUIDを自動的に追加しますが、もちろん、リッスンできるポート番号が必要です。構成セクションのドキュメントについては、このMSDNページを参照してください。おおまかに次のようになります。

<system.serviceModel>
    <!-- client section omitted -->
    <bindings>
        <wsDualHttpBinding>
            <binding name="PoBindings1"
                     clientBaseAddress="http://localhost:8080/Callbacks/">
                <!-- extra config elements and attributes omitted -->
            </binding>
        </wsDualHttpBinding>
    </bindings>
    <services>
        <service behaviorConfiguration="DataAccessLayer.POEngineBehavior"
            name="DataAccessLayer.POEngine">
            <endpoint address=""
                      binding="wsDualHttpBinding"
                      bindingConfiguration="PoBindings1"
                      name="PoBindings" contract="DataAccessLayer.IPOEngine">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:8080/Design_Time_Addresses/DataAccessLayer/POEngine/" />
                </baseAddresses>
            </host>
        </service>
    </services>
    <!-- behaviors omitted -->
</system.serviceModel>

デュプレックスコントラクトを使用している場合、サービスコントラクトは通常次のようになります。

[ServiceContract(CallbackContract = typeof(IMyCallbackContract))]
interface IMyContract
{
    [OperationContract]
    void DoSomething();
}

interface IMyCallbackContract
{
   [OperationContract]
   void OnCallback();
}

コールバック機能が必要ない場合は、WSHttpBindingまたは他の「単純な」バインディングの1つを使用する必要があります。WCFに付属するバインディングタイプのリストは次のとおりです

于 2010-05-26T05:08:26.040 に答える