Web Service

GetPorts

Hide Navigation Pane

GetPorts

Previous topic Next topic No directory for this topic  

GetPorts

Previous topic Next topic Topic directory requires JavaScript  

Parameters

PortKey

String


CountryKey

String


Caseless

Boolean


UseRegularExpressions

Boolean




Return Value

PortInfo Array


 

This service call is used to obtain a list of Distance Table ports in the current release from the web service based on the criteria provided.

 

The search capabilities are simple to use but can get as complex as required.

 

Ignoring Regular Expressions for the moment, any character or series of characters in either the PortKey and/or the CountryKey will be matched anywhere in the Port name or Country.

 

i.e. Searching with a PortKey of port will return a list of ports that have the port anywhere in the name, it will find Andiport, Bayport etc. It will NOT find "Aalborg Portland" as the comparison is done using the case of the PortKey.  To find all ports containing port set Caseless to true.

 

We can limit the search used above to only those ports in the U.S.A by adding this as the CountryKey.

 

For more complicated searches you can use Regular Expressions.  A full explanation of the use of regular expressions is beyond the scope of this help.  The web contains many references on how to use Regular Expressions. A few examples:-

 

Caseless search for PortKey of [B].*ort will find any Port name with a capital B followed by any number of characters and then the letters ort. Running this will return "Aalborg Portland", BayPort, "Mozambique Port" etc.

 

Extending the previous search by adding ^u as the CountryKey will further restrict the previous search to only those ports whose Country begins with the letter u

 

Call Examples

 

<ServiceInstance>.GetPorts("port","",false,false);

<ServiceInstance>.GetPorts("port","U.S.A",false,false);

<ServiceInstance>.GetPorts("[B].*ort","",true,true);

<ServiceInstance>.GetPorts("[B].*ort","^u",true,true);

 

This method does not require logging into the service and is publicly available.