none
WCF REST Service works with IP address but not with hostname RRS feed

  • Question

  • Hi!

    I have a WCF REST Service that went from localhost to public internet. I created a no-ip address, did the port forwarding from the router and all that stuff.

    So lets say that my no-ip account has associated a hostname myname.no-ip.org and a temporary IP address 188.112.10.98:8206 (8206 is the port of my service).

    The strange thing is that when I use the IP address in the URL, everything works fine (GET, POST, DELETE methods) but when I use my hostname instead only GET methods work correctly, the POST and DELETE methods return a 405 status code (method not allowed).

    I have tried a lot of webconfig stuff but couldn't resolve the issue, does somebody have the answer? Please, I have been struggling with this for a couple of days.

    Thanks!

    Thursday, October 23, 2014 2:24 AM

All replies

  • Hi,

    Generally, the HTTP response with status 405 means method Not Allowed. However, as you described, when you use the ip address, GET, POST, DELETE methods work fine.

    For this situation, you could try to check the requested ip address(to get the ip, you can use the fiddler tool to check the requested url property), after you use the hostname as the request url. Then, you can just change the hostname with the ip to have a test, whether GET, POST, DELETE methods work fine.

    Besides, you can also check whether there are some privilge setting for the post, delete methods etc..

    Regards

    Friday, October 24, 2014 7:37 AM
    Moderator
  • Hi,

    Thanks for the response!

    What you suggest me is to find the IP address and replace the hostname with it? In that case, that's what I have been doing and when I do that, GET, POST, and DELETE works fine! The thing is that when I use the hostname in the URL GET methods return 200 code but POST and DELETE return 405.

    Why does this happen when I use the hostname instead of the IP address?

    If what you meant is not what I understood, please give me some explanation please.

    Thanks again!

    Rodrigo

    Saturday, October 25, 2014 5:20 AM