簡體   English   中英

如何發布WCF服務?

[英]How can I Publish my WCF Service?

我想在互聯網上使用我的網絡服務。 我打開了端口4501,這是我在調制解調器和Windows上禁用的防火牆。 我可以編寫全局IP,也可以打開調制解調器控制接口。 但我想連接到iis,其地址為xx.xx.xx.xx:4501 / Products.svc

它可以在localhost(http:// localhost:4501 / Product.svc)上工作,但是我無法連接到Internet上的svc。

我不知道哪里出了問題。

當我將svc鏈接地址添加為參考服務時,出現此錯誤

  There was an error downloading 'http://xx.xx.xx.xx:4501/Products.svc'.
  Unable to connect to the remote server
  Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
  Metadata contains a reference that cannot be resolved:                         'http://xx.xx.xx.xx:4501/Products.svc'.
  There was no endpoint listening at http://xx.xx.xx.xx:4501/Products.svc that could           accept the message. This is often caused by an incorrect address or SOAP action. See    InnerException, if present, for more details.
  Unable to connect to the remote server
  Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
  If the service is defined in the current solution, try building the solution and      adding the service reference again.

還有一點

如果我開始使用IIS,則即使在localhost中,wcf服務也不起作用。 如果我在Visual Studio中啟動它(我的意思是asp.net開發服務有效),那么它將起作用。

IIS版本為7.5.7600,我將應用程序池添加為Asp.net 4.0

在IIS中將端口4501用於HTTP時,是否有任何特定原因?

Visual Studio 2010 WebDev WebServer(Cassini)使用隨機端口號(在您的情況下為4501)簡化配置。 假定端口80可以被其兄弟IIS或任何其他軟件占用。

這對於在本地計算機上進行開發很好,但是在生產中無需使用相同的端口。

默認的HTTP端口是80,通常是網絡中最開放的端口。

使用端口80進行IIS中的HTTP通信,您的生活將更加輕松。

PS您嘗試過http://xx.xx.xx.xx/Products.svc嗎? 端口號是Web服務配置的一部分,將應用程序移至IIS時不會被復制。 IIS可能已經使用默認的HTTP端口。

暫無
暫無

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

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