2010-05-25 6 views
2

ADO.NET iSeries 드라이버를 사용하는 C# 응용 프로그램의 IBM.Iseries 데이터베이스에 연결되었습니다. 내 WCF 서비스가WCF 테스트 클라이언트 서비스를 호출하지 못했습니다.

"TCP 포트 80이 다른 응용 프로그램에서 사용되고 있기 때문에 HTTP는 URL http://+:80/Temporary_Listen_Addresses/771be107-8fa3-46f9-ac01-12c4d503d01e/을 등록 할 수 없습니다."라는 오류가 발생합니다. IBM의 데이터 액세스를 사용하지 않고 또한 문제가

<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> 

. 정상적인 Hello World에서도 오류가 발생합니다 .Where 포트 주소를 변경해야하는 경우

+0

IBM 데이터 액세스를 사용하지 않고 문제가 발생했습니다. 정상적인 Hello World에서도 오류가 발생합니다. 포트 주소를 변경해야하는 경우가 있습니다. – renjucool

+0

포트를 8080으로 변경 했는데도 오류가 지속됩니다. – renjucool

+0

해당 서버 app.config 섹션을 게시 할 수 있습니까? – Vitalik

답변

1

"문제"는 wsDualHttpBinding을 사용하여 이중 계약 (서버가 클라이언트를 다시 호출 함)을 사용한다는 것입니다. 이 기능이 필요합니까? 그럴 경우 바인딩 구성에 clientBaseAddress을 지정하여 클라이언트가 수신 대기 할 주소를 입력해야합니다. 또한 PoBindings1 바인딩 구성을 사용하도록 끝점에 지시해야합니다.

WCF는 고유 한 끝점 주소를 생성하도록 GUID를 기본 주소에 자동으로 추가하지만 물론 수신 할 수있는 포트 번호가 필요합니다. 구성 섹션의 문서는 this MSDN page을 참조하십시오. 그것은 다음과 같이 대략 같아야합니다

<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 또는 다른 "단순"바인딩 중 하나를 사용합니다. Here은 WCF와 함께 제공되는 바인딩 유형 목록입니다.

+0

내가 멈추었을 때 iis 서비스가 작동 중일 때 – renjucool

+0

wcf 서비스가 이중 모드에서 Windows 작업 흐름과 통신해야하므로 wsDualHttpBinding이 필요합니다. – renjucool

+0

@renjucool : 포트 80을 사용하고 있기 때문에 의미가 있습니다. 위의 구성에 표시된 것과 같은 다른 포트를 사용하도록 지정하십시오. – Thorarin

관련 문제