开发者

Error attempting to access a web service (hosted locally or externally), can't resolve host name

开发者 https://www.devze.com 2022-12-18 18:00 出处:网络
I\'m stumped.I\'ve got an asp.net mvc app being hosted on a shared hosting provider.The configuration of their system leaves a little to be desired, but it\'s cheap (getting what I pay for I suppose..

I'm stumped. I've got an asp.net mvc app being hosted on a shared hosting provider. The configuration of their system leaves a little to be desired, but it's cheap (getting what I pay for I suppose...)

The problem is this: The application is hosted at the root level of the hosting account. I have a virtual directory established underneath the root that is running a .net 2.0 web app along with a web service. I can access the web service directly via the domain/subdirectory url. The main web app (at the root level) needs access to the web service in the virtual (subdirectory). Locally in development, I can run the app against the web service out on the hosting server and it runs just fine. When I push the web app up to the root of the hosting service, I get "The remote name could not be resolved: ".

At first I thought the error was related to the DNS settings of the primary domain since both the web app and web service technically live at the same domain. As part of just trying to get something working, I reverted the web app to reference an older version of the web service on a different server (different host altogether). Again, it works fine locally. When I push the updated web app, I got the same error, but noticed the host name referenced is that of the external domain. Of course, I can access the web service via the browser just fine.

Sorry if this doesn't make total sense... it's late and I'm beat from looking at this for the last few hours. Any开发者_如何学JAVA help would be greatly appreciated.

EDIT So the web app simply has a Web Reference to the web service (I could probably just restructure the app avoiding the web service altogether, but time is of the essence [for now]). Since I got stuck last night, I pointed the web reference back to an old server but the issue remains. Right now the url the web reference points to is http://road34.hi-fisoftware.com/webservices/giigsterservice.asmx.


If the server has a firewall then and an external ip and different internal ip then probably you will not be able to access the webservice with the domain name. you will need to access it as internal url or as relative url.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号