ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Web service functions
  • Managing the type of address
  • Special cases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
WebserviceClientIPAddress (Function)
In french: WebserviceAdresseIPClient
Returns the IP address of the computer using and calling the web service.
Warning: the web service must be hosted by the WEBDEV Application Server..
Example
// Renvoie l'adresse IP du consommateur
AdresseClient is string
AdresseClient = WebserviceClientIPAddress()
Syntax
<Result> = WebserviceClientIPAddress([<Type of address>])
<Result>: Character string
IP address of the computer of the Web user:
  • If the connection is in IPv4, the response is in the format "xxx.xxx.xxx.xxx" (for example: 195.196.100.1).
  • If the connection is in IPv6, the response is in IPv6 format.
<Type of address>: Optional boolean
  • True to retrieve the initial address specified in the HTTP header,
  • False (default) to retrieve the IP address in the environment variable "REMOTE_ADDR" defined by the Web server.
Remarks

Managing the type of address

The address returned by WebserviceClientIPAddress may not correspond to the user's address (if a non-transparent proxy or a load balancer is used, for example). In this case, WebserviceClientIPAddress returns the IP address of the proxy or load balancer.
If the initial address is requested, WebserviceClientIPAddress tries to read the address specified in the HTTP headers. Indeed, most of the proxies provide the initial address in the HTTP headers. However, this address must be used with caution because it is not reliable and can be completely wrong.

Special cases

  • If the original address is not found or is invalid (too long for example), the "standard" address is sent.
  • The server IP address is returned by NetIPAddress.
  • WEBDEV - Server code If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.
Component: wd300awws.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help