1)I am creating a ASP.NET Web Application-> Empty (Web Api selected) project in VS2013 and adding service reference (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>
I'm was debugging and got error in webapi project : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond X.X.XXX.XXX:443
But I am trying a windows project (add service refence too) everything same (web config and using). It is working fine.