Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 
Computing > 4 - Advanced manipulation of the items > Getting the login details

4.2.3 Getting the login details

You can directly login to the FTP space associated with the user with any ftp client.

Let's look at how to retrieve the information we need for the connection:
  • The username and password are the same as those used during authentication.
  • To retrieve the public IP address of our FTP server we use the method GetPurchasedFTP which returns all the information on the service.

Here is an example of a method that retrieves the IP address of the FTP server previously purchased.
//IWsEndUser.GetPurchasedFTP Method (c# .NET)
private string GetFTPServerIP(WsEndUserClient client)
{
    try
    {
        //calls the GetPurchasedFTP method, 
        //getting a WsResultOfFTP object
        WsResultOfFTP result = client.GetPurchasedFTP();

        //if the call fails; it relaunches the error indicating the message
        if (result.Success)
        {
            //extracts the public IP of the FTP server
            FTPServer ftpServer = result.Value.FTPServer;
            return ftpServer.PublicIPAddress;
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //relaunches the error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.getPurchasedFTP Method (JAVA)
private String GetFTPServerIP(IWsEndUser client)
{
    String ipaddress = null;
    
    try
    {
        //calls the getPurchasedFTP method, 
        //getting a WsResultOfFTP object
        WsResultOfFTP result = client.getPurchasedFTP();

        //if the call fails; it relaunches the error indicating the message
        if (result.isSuccess())
        {
            //extracts the public IP of the FTP server
            FTPServer ftpServer = result.getValue().getFTPServer();            
            ipaddress = ftpServer.getPublicIPAddress();
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
    
    return ipaddress;
}

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also

API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl