我已经创建了wcf服务。我在vs2017中使用“添加服务refence”添加了该服务。 添加我尝试使用以下功能(c#)
访问的服务后List<ProductData> data = new List<ProductData>();
ServiceReferenceIHS.PriceClient ns = new ServiceReferenceIHS.PriceClient();
data = ns.GetPricesData(clientName, password, lstISHCode.ToArray(), Startdate, EndDate).ToList();
我正在为GetPricesData
方法提供值。
以下是异常消息。
There was no endpoint listening at http://localhost:8080/Test.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
这是appconfig配置。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPrice" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8080/Test.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPrice"
contract="ServiceReferenceIHS.IPrice" name="BasicHttpBinding_IPrice" />
</client>
</system.serviceModel>
我的代码出了什么问题。