To get the correct port number which need to be used in the connection, open the TDV Studio, Navigate to Administration > Configuration > Server > Web Services Interface > Communications> HTTP > Port (Current). Below is the reference image:
If you don't have access to the TDV studio, then we can get the base port information from the 'server_values' file present inside the installation directory of the TDV server.
Example: C:\Program Files\TIBCO\TDV Server 8.0\conf\server
Inside it, search for the tag '/server/webservices/communications/http/port' and we can see the base port value. Now, you can add the integer value as per the above reference image to get the corresponding port number.