0

I need to get the domain from which the SOAP Client is being used so I was wondering if anyone knows how to get it without the use of: $_SERVER['HOST_NAME'] and get it from the headers or something like that because I need to know exactly from which it comes and not pass some params that can be edit.

Well thank you in advance.

apz2000
  • 132
  • 6
  • 14
  • 2
    Are you wondering about how they're calling the server, or where they're coming from? HOST_NAME is the name they called the server when they contacted it. You want REMOTE_ADDR for the client, and then do a DNS lookup on them (or whois if that fails, to at least identify the owner of the ip block) – Joe Jan 27 '12 at 17:07

1 Answers1

0

For the Server side you can use $_SERVER['HTTP_REFERER'], But I would read this thread first:

Determining Referer in PHP

Community
  • 1
  • 1
Robert Peters
  • 3,814
  • 1
  • 17
  • 9
  • Are there HTTP referers involved with SOAP requests? – hakre Jan 27 '12 at 17:14
  • If they are done over http (most common use of soap) then yes. – Robert Peters Jan 27 '12 at 18:09
  • But now that I think about it, you one might only be able to get the IP address not the domain $_SERVER['REMOTE_ADDR']; – Robert Peters Jan 27 '12 at 18:22
  • I would say so, too after reading the question again. OP asks from the server point of view and wants to learn about the client host (and not about a previous request of the client - if any). – hakre Jan 28 '12 at 11:56