How to get AOS Port number in MSD axapta by code

To get AOS Port number in axapta by code you can try following code in job.

 Str PortInfo;  
 PortInfo=strfmt("Port number of AOS IS: %1",int2str(Session::getAOSPort()));  
 info(PortInfo);  


Here session is class and getAOSPort is method. You can view port number in message box.