PDA

View Full Version : WWW or not WWW


bruce
08-04-2008, 10:19 AM
i tested http://viktorphoto.com/GalleryService.svcand I didn't get any error!

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

vitya
08-04-2008, 10:41 AM
Hi,

I created a WCF web service, modified it according to what I found on the net about DASP hosting, and uploaded it to my web site, www.viktorphoto.com (http://www.viktorphoto.com/). The address of the WCF service is http://www.viktorphoto.com/GalleryService.svc
This works all right.

However, if I omit the www from the url, e.g. http://viktorphoto.com/GalleryService.svcthe service is not found, see error in browser.

The funny thing is that the other parts of the web site work correctly either way, but when visited from http://viktorphoto.com (http://viktorphoto.com/)everything works, except the WCF related parts.

Any ideas are welcome!

vitya

vitya
08-05-2008, 05:51 AM
Hi Bruce!

Thanks for checking in!

Yes, it works now, because last night (very late at night) I figured out what the problem was (just didn't have the strength to post a follow up here - sorry about that.

So the solution was to modify the web.config file so that the service listens at both addresses:




<service behaviorConfiguration="GalleryServiceBehavior" name="GalleryService">


<endpoint binding="basicHttpBinding" contract="IGalleryService" address="http://viktorphoto.com/GalleryService.svc"/>


<endpoint binding="basicHttpBinding" contract="IGalleryService" address="http://www.viktorphoto.com/GalleryService.svc"/>


<endpoint binding="mexHttpBinding" contract="IMetadataExchange" address="mex" />


</service>

I still don't understand why, since the rest of the site was working OK, but now it works. However, it would be great if someone could tell me why the problem existed in the first place.

cheers

vitya