[英]No endpoint listening wcf/rest
所以我之前的問題圍繞着將wcf轉換為將WCF服務轉換為RESTful應用程序的寧靜服務? ,我設法做了一些幫助!
但是我的客戶遇到了一個新問題:
在http:// localhost:26535 / Service1.svc上沒有可以接受該消息的端點。
這通常是由錯誤的地址或SOAP操作引起的。 有關更多詳細信息,請參閱InnerException(如果存在)。
現在,從屏幕轉儲中可以看到restful服務運行:
我可以從url中添加值1,如下所示:
但是我似乎無法在另一個新的visual studio實例上運行它,我的客戶端app.config看起來像這樣:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="WebHttpBinding_IService1">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport></httpTransport>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:26535/Service1.svc" binding="customBinding" bindingConfiguration="WebHttpBinding_IService1"
contract="ServiceReference1.IService1" name="WebHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
客戶代碼:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
public ServiceReference1.Service1Client testClient = new ServiceReference1.Service1Client();
private void button1_Click(object sender, EventArgs e)
{
label1.Text = testClient.GetData(Convert.ToInt32(textBox1.Text));
}
}
}
我在這里查看SO中此區域的先前問題: WCF - “沒有端點監聽...”錯誤
但它沒有提供解決方案? 我不熟悉IIS上的托管或者這不僅僅是練習,所以讓它在調試(F5)上工作將是zer goood!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.