Client Information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Elgram

    #1

    Client Information

    Hello,
    I have a webservice designed in VS 2005 using C#. I would like to know
    the URL and the IP addresses of the people who are accessing my service. Is
    this a possibility? if so how?

    Thanks,
    --
    -Scott


  • Robby Valles

    #2
    Re: Client Information

    Scott,

    Please try the following in your webservice class.

    Context.Request .UserHostAddres s

    That should be available and what you need. Let me know... email me if
    you'd like.

    Robby Valles

    On Oct 29, 1:16 pm, "Scott Elgram" <SElg...@verifp oint.comwrote:
    Hello,
    I have a webservice designed in VS 2005 using C#. I would like to know
    the URL and the IP addresses of the people who are accessing my service. Is
    this a possibility? if so how?
    >
    Thanks,
    --
    -Scott

    Comment

    • John Saunders [MVP]

      #3
      Re: Client Information

      "Scott Elgram" <SElgram@verifp oint.comwrote in message
      news:%23$GsojmG IHA.284@TK2MSFT NGP02.phx.gbl.. .
      Hello,
      I have a webservice designed in VS 2005 using C#. I would like to know
      the URL and the IP addresses of the people who are accessing my service.
      Is
      this a possibility? if so how?
      What do you mean, "URL"? What do you mean, "people"? People don't have URLs,
      and URLs don't access web services. Please give us more detail.
      --
      --------------------------------------------------------------------------------
      John Saunders | MVP - Windows Server System - Connected System Developer


      Comment

      • Scott

        #4
        Re: Client Information

        Ok, in detail...
        I have created a WebService in VS 2005 using C# that returns the results
        of a database search in an XML dataset .
        The purpose is to allow clients access to this webservice so that they
        can utilize the search options I make public through the webservice. By
        doing it this way clients who use this service should be able to incorporate
        my data into their website as if it were their own.
        What I am trying to record is the URL of the page that accessed the
        webservice and the IP of the domain that page is under.
        For example:
        The company XYZ.com (IP: 111.111.111.111 ) would like to use my data
        on their website. using the webservice I have created they access the
        webservice through code on www.xyz.com/search.aspx which returns an XML
        dataset which they can display on their page.
        In this example what I would like to record is "www.xyz.co m/search.aspx"
        and "111.111.111.11 1".

        Let me know if that still doesn't make sense.
        Thanks,
        -Scott


        "John Saunders [MVP]" <john.saunder s at trizetto.comwro te in message
        news:uNApLolHIH A.1208@TK2MSFTN GP03.phx.gbl...
        "Scott Elgram" <SElgram@verifp oint.comwrote in message
        news:%23$GsojmG IHA.284@TK2MSFT NGP02.phx.gbl.. .
        Hello,
        I have a webservice designed in VS 2005 using C#. I would like to
        know
        the URL and the IP addresses of the people who are accessing my service.
        Is
        this a possibility? if so how?
        >
        What do you mean, "URL"? What do you mean, "people"? People don't have
        URLs,
        and URLs don't access web services. Please give us more detail.
        --
        --------------------------------------------------------------------------
        ------
        John Saunders | MVP - Windows Server System - Connected System Developer
        >
        >

        Comment

        • Scott

          #5
          Re: Client Information

          Thanks for your reply and I'm sorry it took so long for me to get back to
          this.
          I tried what you suggested and I now get the IP address of the site that
          is accessing the service. Thank you very much, however, I would also like
          to get the name of the page that is calling the service. I tried using
          "Context.Reques t.Url.AbsoluteP ath" but all I get is the address of the
          services asmx file. i.e. /SiteFolder/Service.asmx

          if you can offer any info to resolve this as well it would be much
          appreciated.

          -Scott

          "Robby Valles" <robby.valles@g mail.comwrote in message
          news:1193977772 .509923.26040@1 9g2000hsx.googl egroups.com...
          Scott,
          >
          Please try the following in your webservice class.
          >
          Context.Request .UserHostAddres s
          >
          That should be available and what you need. Let me know... email me if
          you'd like.
          >
          Robby Valles
          >
          On Oct 29, 1:16 pm, "Scott Elgram" <SElg...@verifp oint.comwrote:
          Hello,
          I have a webservice designed in VS 2005 using C#. I would like to
          know
          the URL and the IP addresses of the people who are accessing my service.
          Is
          this a possibility? if so how?

          Thanks,
          --
          -Scott
          >
          >

          Comment

          • John Saunders [MVP]

            #6
            Re: Client Information

            "Scott" <Scott@verifpoi nt.comwrote in message
            news:%2378c1nXJ IHA.1184@TK2MSF TNGP04.phx.gbl. ..
            You missed my purpose.
            I am not trying to use this information to identify proper usage. Just
            simply collecting data of who is using it and when. If the IP address is
            that of a NAT box or some other piece of hardware that is fine. The
            people
            that have asked me to get this information realize everything that you
            have
            mentioned and they realize that this information may not always be
            accurate
            or available. That, however, doe snot stop them from wanting to log it.
            For arguments sake, lets say the information I am trying to retrieve is
            available due to however the client has set up their site. I have managed
            to get the IP address but I am still stuck on how I can get the URL. So
            far
            I have only been able to retrieve the address of the ASMX file not
            whatever
            called it.
            Scott, there _is_ no URL. What it the client that called your web service
            was not a web page? In that case, there would be no URL to pass, so the web
            services infrastructure _never_ passes any URL.

            Sorry, but if you want to log the URL of the web page that called the web
            service, then you'll have to make the web page pass the URL to the service.
            This could be done as a parameter to every web service operation, or it
            could be done through a custom SOAP Header.
            --
            --------------------------------------------------------------------------------
            John Saunders | MVP - Windows Server System - Connected System Developer


            Comment

            • Scott

              #7
              Re: Client Information

              If the client that called the service is not a page then the variable should
              simply be null. But, the main purpose here is so that clients could access
              specific functions with the info in our database from a webpage. So
              assuming that it is indeed a webpage that calls the web service is there
              still no way to get the URL of that page?

              "John Saunders [MVP]" <john.saunder s at trizetto.comwro te in message
              news:uKBPn0XJIH A.4592@TK2MSFTN GP02.phx.gbl...
              "Scott" <Scott@verifpoi nt.comwrote in message
              news:%2378c1nXJ IHA.1184@TK2MSF TNGP04.phx.gbl. ..
              You missed my purpose.
              I am not trying to use this information to identify proper usage.
              Just
              simply collecting data of who is using it and when. If the IP address
              is
              that of a NAT box or some other piece of hardware that is fine. The
              people
              that have asked me to get this information realize everything that you
              have
              mentioned and they realize that this information may not always be
              accurate
              or available. That, however, doe snot stop them from wanting to log it.
              For arguments sake, lets say the information I am trying to retrieve
              is
              available due to however the client has set up their site. I have
              managed
              to get the IP address but I am still stuck on how I can get the URL. So
              far
              I have only been able to retrieve the address of the ASMX file not
              whatever
              called it.
              >
              Scott, there _is_ no URL. What it the client that called your web service
              was not a web page? In that case, there would be no URL to pass, so the
              web
              services infrastructure _never_ passes any URL.
              >
              Sorry, but if you want to log the URL of the web page that called the web
              service, then you'll have to make the web page pass the URL to the
              service.
              This could be done as a parameter to every web service operation, or it
              could be done through a custom SOAP Header.
              --
              --------------------------------------------------------------------------
              ------
              John Saunders | MVP - Windows Server System - Connected System Developer
              >
              >

              Comment

              • John Saunders [MVP]

                #8
                Re: Client Information

                "Scott" <Scott@verifpoi nt.comwrote in message
                news:%23HqlbScJ IHA.5860@TK2MSF TNGP04.phx.gbl. ..
                If the client that called the service is not a page then the variable
                should
                simply be null. But, the main purpose here is so that clients could
                access
                specific functions with the info in our database from a webpage. So
                assuming that it is indeed a webpage that calls the web service is there
                still no way to get the URL of that page?
                No. Not unless the page sends it to the service.

                Remember that a web service simply receives some XML sent by some code.
                There's nothing to indicate whether the code was a page, or which page it
                was.
                --
                --------------------------------------------------------------------------------
                John Saunders | MVP - Windows Server System - Connected System Developer


                Comment

                • Scott

                  #9
                  Re: Client Information

                  Thanks, I'll have to just be happy woth the IP address then

                  "John Saunders [MVP]" <john.saunder s at trizetto.comwro te in message
                  news:uZF02mgJIH A.4272@TK2MSFTN GP05.phx.gbl...
                  "Scott" <Scott@verifpoi nt.comwrote in message
                  news:%23HqlbScJ IHA.5860@TK2MSF TNGP04.phx.gbl. ..
                  If the client that called the service is not a page then the variable
                  should
                  simply be null. But, the main purpose here is so that clients could
                  access
                  specific functions with the info in our database from a webpage. So
                  assuming that it is indeed a webpage that calls the web service is there
                  still no way to get the URL of that page?
                  >
                  No. Not unless the page sends it to the service.
                  >
                  Remember that a web service simply receives some XML sent by some code.
                  There's nothing to indicate whether the code was a page, or which page it
                  was.
                  --
                  --------------------------------------------------------------------------
                  ------
                  John Saunders | MVP - Windows Server System - Connected System Developer
                  >
                  >

                  Comment

                  Working...