Location data type

Official Content
This documentation is valid for:

Configures the calls to GeneXus' main objects remotely, when using SOAP protocol. 


Objects: Procedure, Transaction, Web Panel
Generators: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)


When you call a remote object via SOAP, you use the Location data type to configure the invocation.

First, you need to associate a Location variable to an existing location through GetLocation function, and then configure the call using the Location data type properties. You can use GetSOAPErr and GetSOAPErrMsg functions to check for errors.



The Location Data Type can be used, for example, to change the WebService Host, or to give the user a more friendly error message for a WebService problem.

If you have a WebService External Object named "MyWebService", and a variable based on this WebService in an object, the location can be used as:

&location = getLocation("MyWebService")
&location.Host = 'www.genexus.com'  // don't include protocol (i.e. HTTP/HTTPS)
&location.BaseUrl = '/services/'
&location.port = 443
&location.secure = 1 // For WebService in Secure Server.
&location.CancelOnError = 2 // When you want to manage the errors (1)

(1) - Error information can be obtained using the GetSoapErr and GetSoapErrMsg functions.

More Details

It also commonly uses Location.xml, in order to specify location settings
The properties specified in runtime by means of a location Datatype, will have preference over the ones specified in runtime by means of a location.xml file, and the latter, in turn, will have preference over the ones specified in generation time; this will allow  more dynamism in the locations setting.

Since GeneXus X Evolution 3 Upgrade 7 location is working properly, when the Use Native Soap property is active Previous Versions is not working.

In case of Authentication or Proxy Authentication, it's necessary to know the realm name in order to work properly. Otherwise, an error occur when the services is invoked.
i.e.: if a proxy is used and the property ProxyAuthenticationRealm was not defined, the following error will be shown when executing the service:
407: Proxy Authentication Required

In some particular cases of Service Soap, is necessary to configure more data in the location datatype. For that reason is provided a way to extend the location data type. Read more about it at this page: GxSoapHandlers mechanism for extending Location Data type.
It only applies when the Use Native Soap property is active.

GetLocation Function
GetSOAPErr Function
GetSOAPErrMsg Function