how to determine hosted server url from within wcf service?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paul korosi

    how to determine hosted server url from within wcf service?

    Hi, I've got a wcf service that is hosted on my local machine. I need to
    determine the hosted url of the service from within the service but cannot
    work out how to do it.
    HttpContext.Cur rent always returns null, which i suppose might make some
    sense. Does anyone know of a way to get the url?

    TIA,

    paul


  • Duy Lam

    #2
    Re: how to determine hosted server url from within wcf service?

    paul korosi wrote:
    Hi, I've got a wcf service that is hosted on my local machine. I need to
    determine the hosted url of the service from within the service but cannot
    work out how to do it.
    HttpContext.Cur rent always returns null, which i suppose might make some
    sense. Does anyone know of a way to get the url?
    >
    TIA,
    >
    paul
    >
    >
    Where did you host your service? A Windows service, IIS or normal
    program (console or winform)?



    --
    Thanks,
    Duy Lam Phuong

    Comment

    • paul korosi

      #3
      Re: how to determine hosted server url from within wcf service?

      "Duy Lam" <duylamphuong@g mail.comwrote in message
      news:e4uJkBOlIH A.2304@TK2MSFTN GP05.phx.gbl...
      paul korosi wrote:
      >Hi, I've got a wcf service that is hosted on my local machine. I need to
      >determine the hosted url of the service from within the service but
      >cannot work out how to do it.
      >HttpContext.Cu rrent always returns null, which i suppose might make some
      >sense. Does anyone know of a way to get the url?
      >>
      >TIA,
      >>
      >paul
      >
      Where did you host your service? A Windows service, IIS or normal program
      (console or winform)?
      >
      >
      >
      --
      Thanks,
      Duy Lam Phuong
      sorry - should have said. it's hosted on IIS.

      cheers,

      paul


      Comment

      • Marc Gravell

        #4
        Re: how to determine hosted server url from within wcf service?

        Uri uri = OperationContex t.Current.Incom ingMessageHeade rs.To;

        Marc


        Comment

        • paul korosi

          #5
          Re: how to determine hosted server url from within wcf service?

          "Marc Gravell" <marc.gravell@g mail.comwrote in message
          news:%237M1znVl IHA.696@TK2MSFT NGP05.phx.gbl.. .
          Uri uri = OperationContex t.Current.Incom ingMessageHeade rs.To;
          >
          Marc
          >
          Thanks Marc - you're a champ.


          Comment

          • Marc Gravell

            #6
            Re: how to determine hosted server url from within wcf service?

            No problem; sorry the reply was so terse, but I was in a hurry...

            Marc

            Comment

            Working...