【发布时间】:2016-03-18 12:30:12
【问题描述】:
1)我正在VS2013中创建一个ASP.NET Web Application-> Empty (Web Api selected)项目并添加服务引用(wsdl)
public class BJKController : ApiController
{
[HttpGet]
public byte[] GetArchive(string workOrderNo)
{
BjkClient client =new BjkClient();
return client.GetInvoice(workorderNo);//I'm getting error this line
}
}
web.config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ICompany" maxReceivedMessageSize="64000000">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://service.karakartal.com.tr/Company.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ICompany"
contract="ServiceReference1.ICompany" name="WSHttpBinding_ICompany" />
</client>
</system.serviceModel>
我在调试webapi项目报错:连接尝试失败,因为连接方一段时间后没有正确响应,或者建立连接失败,因为连接的主机没有响应XXXXX.XXX:443
但我正在尝试一个 Windows 项目(也添加服务引用) 一切都一样(网络配置和使用)。它工作正常。
【问题讨论】:
-
你能在浏览器中成功打开你的服务的url吗?
-
@RicardoPontual 是的。我可以调试。
标签: wcf asp.net-web-api service-reference