Итак, мой предыдущий вопрос вращался вокруг поворота wcf в спокойное обслуживание convert a WCF Service, to a RESTful application?, что мне удалось сделать с некоторой помощью!Нет конечной точки прослушивания wcf/rest
Но я бег в новую проблему от моего клиента:
There was no endpoint listening at http://localhost:26535/Service1.svc that could accept the message.
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Теперь успокоительная служба работает, как можно видеть из дампа экрана:
И я могу добавить от 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 - "There was no endpoint listening at..." error
Но это не дает решения? Я не знаком с хостингом в IIS, или что это не так, просто практика, так что работа над отладочной (F5) будет zer goood!
Какое внутреннее исключение? Это может пролить свет на это. –
Выполнение внутреннего исключения говорит, что удаленный сервер возвратил ошибку: (404) Не найдено. –