none
Call Rest Api from WCF service RRS feed

  • Question

  • Hello,

    In my project, i have requirement  to call external rest api from WCF server.

    I am getting error as The remote name could not be resolved " domain name.com".

    But when I try same thing with console application or asp.net application it is working fine as expected, but as soon as I execute the same code through WCF service i get above error.

    Thanks in advance.

    HarshadaR

    Thursday, August 27, 2015 10:05 AM

Answers

  • Finally I am able to solve this issue by adding proxy address in default proxy tag like :

    <system.net>

    <defaultproxy enabled = "true" usedefaultCredentials = "true">

    <proxy proxyaddress="http://address:port"/>

    </defaultproxy>

    </system.net>

    Thanks.

    • Marked as answer by HarshadaR Friday, August 28, 2015 12:05 PM
    Friday, August 28, 2015 12:05 PM

All replies

  • I am getting error as The remote name could not be resolved " domain name.com".

    " domain name.com" when the DNS  tries to lookup the IP for the domain name, it can't be resolved into an IP to represent the domain name, which is done by a DNS server.

    http://www.networksolutions.com/support/what-is-a-domain-name-server-dns-and-how-does-it-work/

    So you have to resolve when using the WCF service why a DNS look can't resolve the domain name into an IP. You can ping the domain name at the Windows Command prompt to get the IP for the domain name  "ping domain name", which will return the Internet IP for the domain name,  and you can use the IP the config file replacing the domain name for testing purposes.

    Thursday, August 27, 2015 4:56 PM
  • Finally I am able to solve this issue by adding proxy address in default proxy tag like :

    <system.net>

    <defaultproxy enabled = "true" usedefaultCredentials = "true">

    <proxy proxyaddress="http://address:port"/>

    </defaultproxy>

    </system.net>

    Thanks.

    • Marked as answer by HarshadaR Friday, August 28, 2015 12:05 PM
    Friday, August 28, 2015 12:05 PM