簡體   English   中英

我的ASP.NET WCF配置有什么問題?

[英]What Is Wrong With My ASP.NET WCF Configuration?

我有一個嵌套在ASP.NET 4.5 Web應用程序中的WCF服務,在我嘗試指定端口之前,所有程序都運行正常。 我必須根據客戶的要求在單獨的端口上運行,但是我無法弄清楚自己在做什么錯。

現在,我正在本地運行所有程序,並且確實在防火牆上打了個洞,所以我知道這不是問題所在。 我收到的錯誤-System.Net.Sockets.SocketException:無法建立連接,因為目標計算機主動拒絕了它127.0.0.1:59031-告訴我我沒有連接任何偵聽器,因此,它必須是我的配置。 對?

這是一個電話:

http://localhost:59031/seoland/seo.svc/Login?User=test&Pass=pass

這是我的配置:

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false" />
    <services>
      <service name="seoland.extranet.seo">
        <endpoint address="" behaviorConfiguration="json" binding="webHttpBinding" name="MainHttpPoint" contract="seoland.extranet.seo">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" name="MexEP" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:59031/seoland/seo.svc"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding openTimeout="00:10:00" sendTimeout="00:10:00" useDefaultWebProxy="false">
          <readerQuotas maxDepth="32" maxStringContentLength="2048000" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name="json">
          <webHttp helpEnabled="false" automaticFormatSelectionEnabled="false" defaultBodyStyle="Bare"/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding" httpGetBindingConfiguration=""/>
          <serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false" includeExceptionDetailInFaults="true"/>
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="http" port="59031"/>
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

再一次,一切正常,直到我嘗試添加端口號-有人可以幫幫我嗎?

謝謝!

您使用的端口號正確嗎? 另外,請確保沒有防火牆限制,並且端口處於打開狀態。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM