none
WCF in subdomain/subdirectory RRS feed

  • Question

  • Hi,

    I have a domain name and a hosting account at a provider and when I create a WCF service I can upload it to my web site and use it with no problem.
    However, when I create a subdomain that points to a folder in the same web site (and the folder IS configured as a virtual directory) my WCF service stops working and gives me this error message:

    There is no compatible TransportManager found for URI 'http://test.viktak.com/TestService.svc'. This may be because that you have used an absolute address which points outside of the virtual application. Please use a relative address instead.

    Any idea? I have searched the net on this, but no luck so far.

    This is the web.config file (the relevant parts, anyway):

    <endpoint address="http://test.viktak.com/TestService.svc" binding="basicHttpBinding" contract="ITestService"/>

    Thanks for any pointers!

    viktor

    Saturday, January 10, 2009 1:16 PM

Answers

  • Hi Viktor

    no you don't need all services in the root. But the physical location of the .svc file is the address so you should make the address empty

    so if I have a folder under the vdir called MyServices then the address is

    http://localhost/vdir/MyServices/Service.svc

    You can put a relative address in for the service

    <endpoint address="foo" binding="basicHttpbinding" contract="IService"/>

    then the service address is 

    http://localhost/vdir/MyServices/Service.svc/foo


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    • Marked as answer by VikTak Sunday, January 11, 2009 12:08 PM
    Sunday, January 11, 2009 11:40 AM
    Moderator

All replies

  • you can't use absolute addresses with IIS hosting - the base address is inherent in the location of the .svc file

    Richard Blewett - http://www.dotnetconsult.co.uk/weblog2
    Saturday, January 10, 2009 6:39 PM
    Moderator
  • HI Richard,

    Thanks for the quick reply.

    What does this mean in practise? What address should I put in the endpoint? Relative to what? Or this means I have to put all my WCF services in the root of my web? That would be very inconvenient...

    viktor
    Sunday, January 11, 2009 10:59 AM
  • Hi Viktor

    no you don't need all services in the root. But the physical location of the .svc file is the address so you should make the address empty

    so if I have a folder under the vdir called MyServices then the address is

    http://localhost/vdir/MyServices/Service.svc

    You can put a relative address in for the service

    <endpoint address="foo" binding="basicHttpbinding" contract="IService"/>

    then the service address is 

    http://localhost/vdir/MyServices/Service.svc/foo


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    • Marked as answer by VikTak Sunday, January 11, 2009 12:08 PM
    Sunday, January 11, 2009 11:40 AM
    Moderator
  • Thanks Richard,
    I was able to get it to work at my ISP based on the above info!
    Thanks again!!
    viktor
    Sunday, January 11, 2009 12:08 PM