2013-09-10 24 views
0

我们有一个wcf web服务,外部客户端将用它来提供请求。这个web服务(web服务)调用另一个执行业务逻辑的wcf服务(代理)。WCF webservice需要侦听2个端口iisexpress。 TCP错误代码10061

代理程序还监视数据库中的活动,并且当请求的信息准备好(通常几天后)时,代理程序将生成一个包含请求数据的对象。它需要将对象传递给webservice,webservice将构建XML并将其发布到客户端Web服务。

webservice实现了两种不同的imterface,一种是客户端使用的,另一种是代理使用的。

麻烦的是,在本地机器上,我无法让代理连接到web服务来发送结果。出于调试目的,web服务和代理都在本地计算机上运行。在VisualStudio2012中,webservice项目设置为使用IISExpress并定义要使用的特定端口。项目URL:https://local.someaddress.net:51448/但是,代理用来尝试连接到Web服务的端口是不同的端口。

Web服务能够调用代理,但代理在尝试调用Web服务时会获得tcp错误代码10061。

我已经尝试过“appcmd.exe set app”默认网站/“/enabledProtocols:http,net.tcp”。

是否可以配置IISExpress让webservice打开两个端口?还是有什么明显的我在这里失踪?

(由于配置文件包含链接到本地​​主机和计算器不允许,我与local.someaddress.net代替本地主机。)

这里是Web服务的web.config文件中的内容:

<?xml version="1.0"?> 
<configuration> 

    <system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" maxRequestLength="52428800"/> 
    </system.web> 
    <system.serviceModel> 
    <client> 
     <endpoint address="net.tcp://local.someaddress.net:8102/Acord/201307" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="AcordContract.IAcordService201307" name="AcordEndpoint"> 
     <identity> 
      <certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" /> 
     </identity> 
     </endpoint> 
    </client> 
    <services> 
     <service name="AcordWebService.AcordWebService" behaviorConfiguration="Visible"> 
     <endpoint address="" binding="basicHttpsBinding" contract="AcordWebService.IAcordWebService" bindingConfiguration="BasicHttpsBinding"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
     <!--binding for clients outside the firewall calling from C# with WCF using certs --> 
     <endpoint address="net.tcp://local.someaddress.net:8122/AcordWebService/201309" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" name="NetTcpCertificatesEndpoint" contract="AcordWSContract.IAcordWSService201309"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="NetTcpCertificatesBehavior"> 
      <clientCredentials> 
      <clientCertificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" /> 
      <serviceCertificate> 
       <authentication certificateValidationMode="None" /> 
      </serviceCertificate> 
      </clientCredentials> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="Visible"> 
      <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="false" 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"/> 
      <serviceCredentials> 
      <serviceCertificate findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/> 
      <clientCertificate> 
       <certificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/> 
      </clientCertificate> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <basicHttpsBinding> 
     <binding name="BasicHttpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </basicHttpsBinding> 
     <wsHttpBinding> 
     <binding name="WSHttpBinding_IAcordWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true" allowCookies="false"> 
      <readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     <binding name="WSHttpBinding_Mex" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true" allowCookies="false"> 
      <readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
     <netTcpBinding> 
     <binding name="NetTcpCertificatesBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <security> 
      <transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign" /> 
      </security> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <protocolMapping> 
     <add binding="wsHttpBinding" scheme="https" /> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    <directoryBrowse enabled="true"/> 
    </system.webServer> 
</configuration> 

这里是代理人的app.config文件的内容:

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    </configSections> 
    <system.serviceModel> 
    <client> 
     <endpoint address="net.tcp://local.someaddress.net:8122/AcordWebService/201309" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="AcordWSContract.IAcordWSService201309" name="AcordWSEndpoint"> 
     <identity> 
      <certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" /> 
     </identity> 
     </endpoint> 
     <endpoint address="net.tcp://qaschedapp:8001/IMS/201210" binding="netTcpBinding" bindingConfiguration="NetTcpWindowsBinding" contract="IdentityManagementContract.IIdentityManagementService201210" name="IMSEndpoint"> 
     <!--the name above cannot be changed--> 
     <identity> 
      <dns value="localhost"/> 
     </identity> 
     </endpoint> 
     <endpoint address="net.tcp://qaschedapp:8012/CBS/201210" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="CrossbowContract.ICrossbowService201210" name="CBSEndpoint"> 
     <identity> 
      <certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint"/> 
     </identity> 
     </endpoint> 
    </client> 
    <diagnostics performanceCounters="Default"/> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpWindowsBinding"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
     <netTcpBinding> 
     <binding> 
      <readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> 
     </binding> 
     <binding name="NetTcpWindowsBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 
      <security mode="Transport"> 
      <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/> 
      <message clientCredentialType="Windows"/> 
      </security> 
     </binding> 
     <binding name="NetTcpCertificatesBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <security> 
      <transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign"/> 
      </security> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <services> 
     <service name="AcordAgent.AcordService" behaviorConfiguration="AcordServiceBehavior"> 

     <endpoint address="http://qaschedapp:8100/Acord" binding="webHttpBinding" behaviorConfiguration="HttpWebGetBehavior" contract="AcordContract.IMeta" name="MetaEndpoint"> 
      <!--the name of this endpoint above (MetaEndpoint) must stay--> 
     </endpoint> 
     <!--binding for clients within the firewall calling from C# with WCF --> 
     <endpoint address="net.tcp://qaschedapp:8101/Acord/201307" binding="netTcpBinding" bindingConfiguration="NetTcpWindowsBinding" name="NetTcpWindowsEndpoint" contract="AcordContract.IAcordService201307"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <!--binding for clients outside the firewall calling from C# with WCF using certs --> 
     <endpoint address="net.tcp://qaschedapp:8102/Acord/201307" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" name="NetTcpCertificatesEndpoint" contract="AcordContract.IAcordService201307"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="HttpWebGetBehavior"> 
      <webHttp/> 
     </behavior> 
     <behavior name="NetTcpCertificatesBehavior"> 
      <clientCredentials> 
      <clientCertificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/> 
      <serviceCertificate> 
       <authentication certificateValidationMode="None"/> 
      </serviceCertificate> 
      </clientCredentials> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="AcordServiceBehavior"> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
      <serviceCredentials> 
      <serviceCertificate findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/> 
      <clientCertificate> 
       <certificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/> 
      </clientCertificate> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
    <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> 
    </startup> 
</configuration> 

回答

0

我发现这在IIS快递常见问题解答:

问:IIS Express是否支持非HTTP协议,如net.tcp或MSMQ?答:不可以。IIS Express只支持HTTP和HTTPS作为其协议。

看来这是我的问题的根源。我需要在本地机器上安装IIS。