locked
the remote name could not be resolved. at system.net.httpwebrequest.Getrequeststream RRS feed

  • Question

  • Hi

    I am trying to access a asmx webservice from my web application.Everything was working fine until now.Recently there was a migration happened in the webservice.But the asmx url is the same.

    Now, I am getting the below exception from my code

    Message:The remote name could not be resolved: 'abc'

    StackTrace:   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)

       at System.Net.HttpWebRequest.GetRequestStream()

    What can be the reason for this?


    • Edited by ams16 Thursday, June 11, 2015 8:18 AM
    • Moved by Kristin Xie Friday, June 12, 2015 6:24 AM
    Thursday, June 11, 2015 8:13 AM

Answers

  • When I run the application locally,I am not getting the exception.The problem happens in the deployed code.

    DNS is still the most likely explanation.

    Did you ping from a machine that isn't working to the server, using it's name?

    What happened?


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    • Marked as answer by ams16 Friday, June 12, 2015 10:56 AM
    Thursday, June 11, 2015 11:15 AM

All replies

  • What sort of a migration?

    Can you ping the server using it's name?

    Has it moved servers?

    Check if it's a dns issue.

    Is the asmx definitely there where you think it is?

    Can you try using it just via a web browser and see what happens?

    It's also possibly an iis issue.

    In my experience, I usually see that sort of error when it can't even find the server.


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    Thursday, June 11, 2015 8:58 AM
  • The server where the web service was hosted is changed.But the service url is still the same.

    I am able to access the service using the web browser.

    Thursday, June 11, 2015 9:20 AM
  • If you're using the server name as a url, then try calling using the server IP. If it worked then its a DNS issue.

    Fouad Roumieh

    Thursday, June 11, 2015 9:32 AM
  • What can be the reason for this?

    This sounds like a DNS issues. A network issues, not a programming issue.

    DNS has layers upon layers of caching (at last provider, router and OS), to avoid having to ask to top tier servers of the IANA every time. This usually result in changed IP adresses not being known to everyone the second they changed. It takes some time for the caching times to run out, before the next server is asked again for the IP adress. A common figure is 24-48 hours until everyone get's the new IP adress.

    However in this case you should get an "IP not reachable", rather then "name not resolveable".

    "I am able to access the service using the web browser." Wich Webbrowser? There are design differences here between Internet Explorer, FireFox, Chrome, Safari and the like.

    Actually this might be a fringe issue. I bet that HttpWebReqest Methods do some programm side DNS caching too. If that exception does not close the programm, have you tried just closing the programm and starting it again?
    Or maybe something unrelated like the programm no longer having the proper DNS server entries?


    Thursday, June 11, 2015 9:44 AM
  • When I run the application locally,I am not getting the exception.The problem happens in the deployed code.

    Thursday, June 11, 2015 10:22 AM
  • When I run the application locally,I am not getting the exception.The problem happens in the deployed code.

    I you're going to reply generally like that, it will take long to answer this. Contributors are asking questions and you just commenting as simple as possible.

    Aren't you browsing it from your machine, when you said I can browse?

    The web server is not your machine, we don't know about your network design.

    Is the asmx service hosted on the same as of the web server?

    In general, get your network admin and he must be able to trace that for you.


    Fouad Roumieh

    Thursday, June 11, 2015 11:00 AM
  • When I said I can browse,I meant to say that I am able to access the 'asmx' webservice using the endpoint url from the browser.

    The same webservice is consumed in my application.But from the deployed code, I am getting exception when I try to hit the asmx service.But the same is working fine when I run the code from my local machine.

    The Web server and asmx services are hosted in different servers.

    Thursday, June 11, 2015 11:08 AM
  • When I said I can browse,I meant to say that I am able to access the 'asmx' webservice using the endpoint url from the browser.

    The same webservice is consumed in my application.But from the deployed code, I am getting exception when I try to hit the asmx service.But the same is working fine when I run the code from my local machine.

    The Web server and asmx services are hosted in different servers.

    It could be working successfully between your machine and the asmx host, and that doesn't mean that it should be working between the web hosting server and the web service server. 

    You can do the same test but browsing it from the browser that is on the server.

    Also we not sure if you have like remote access to those servers or its via service providers, in all cases this is a network issue.


    Fouad Roumieh

    Thursday, June 11, 2015 11:13 AM
  • When I run the application locally,I am not getting the exception.The problem happens in the deployed code.

    DNS is still the most likely explanation.

    Did you ping from a machine that isn't working to the server, using it's name?

    What happened?


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    • Marked as answer by ams16 Friday, June 12, 2015 10:56 AM
    Thursday, June 11, 2015 11:15 AM
  • Hi,

    This forum is for C# code issues in specific.

    Your issue is related to ASMX Web Services technology, If others' suggestion still cannot resolve your issue, for a better support on this please post your question to the Web Services forumhttp://social.msdn.microsoft.com/Forums/en-US/asmxandxml/threads

    Thanks for your understanding.

    Best regards,

    Kristin



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, June 12, 2015 6:22 AM
  • yeah that was a DNS issue.

    The webservice url was not accessible from the server.

    Thanks for the replies.

    Friday, June 12, 2015 10:57 AM