سؤال

I have a silverlight application consuming data via RIA. Some methods are exposed in a way that they can be consumed in silverlight as well as in WPF application via Service Reference.On development, these services are called via localhost and everything works fine.I have set my hosts file so that it's all available at subdomain.domain.com. Now (also after a couple of restarts) when I access .svc via different browsers, I get different responses in Chrome and in Internet explorer on the same URL.

Chrome shows: [Name of] Service, To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: ... You can also access the service description as a single file: ...

Internet explorer, Firefox shows: [No name displayed] Service, To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: ... the last part (second url, single file access link) is missing in internet explorer.

But the worst part is, if I enter the same url in VS2012 when adding a service reference, I get this message:

The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved: ...

How can a service give three different responses to virtually the same request?

Update: Perhaps useful information is also that this service is not contained in a separate .svc file but is a ProjectDomainService.cs (and AuthenticationDomainService.cs) and .svc urls are somehow caught automatically (no such file exists on server). And, Chrome behaves the same as Internet explorer if I remove

<add name="Soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

from web.config.

Also, pinging subdomain.domain.com shows my local IP as it should.

هل كانت مفيدة؟

المحلول

The problem seems like it was a simple ID-10-T error. Our company has automatic configuration script set for LAN settings under Internet options (connections). Unchecking this made hosts entries available to all browsers and everything seems to work as expected/desired. While I did know proxies can cause problems when using hosts file, I was unaware of my system settings (it was not set so that it would be visible in settings, but hidden in a configuration file on a network share).

The only browser that worked under these (old) settings was the one that wasn't installed but a portable copy.

As this fixes my problems, I am not sure weather I can expect other unexpected issues now ... but at least it works.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top