1.6 Notices

Using Aruba's WsEndUser GetNews method you can get the list of notifications on the user type licenses that can be purchased, promotions, news, etc..

Parameters
language
Type: string
System.String type value language for which you require the news

Return Value
The method returns an WsResultOfArrayOfNews class object containing detailed information on the News.
Here's an example of the GetNews method
//IWsEndUser.GetNews Method (c# .NET)
private static List<string> GetAllNews(WsEndUserClient client)
{
    List<string> news = new List<string>();

    try
    {
        //sets the language parameter
        String language = "it";

        //calls the GetNews method, 
        //getting a WsResultOfArrayOfNews object
        WsResultOfArrayOfNews result = client.GetNews(language);
        if (result.Success)
        {
            foreach (News item in result.Value)
                news.Add(string.Format("{0} - {1} {2} {3} - {4} - text: {5}",
                    item.NewsID.ToString(),
                    item.Sender.ToString(),
                    item.StartDate.ToString(),
                    item.Category.ToString(),
                    item.Priority.ToString(),
                    item.MessageText));
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //relaunches the error 
        throw new ApplicationException(ex.Message);
    }

    return news;
}
//IWsEndUser.GetNews Method (JAVA)
private static List<String> GetAllNews(IWsEndUser client)
{
    List<String> news = new ArrayList<String>();

    try
    {
        //sets the language parameter
        String language = "it";

        //calls the GetNews method, 
        //getting a WsResultOfArrayOfNews object
        WsResultOfArrayOfNews result = client.getNews(language);
        if (result.isSuccess())
        {
            for (News item : result.getValue().getNews())
            {
                Formatter formatter = new Formatter();
                formatter.format("{%d} - {%s} {%s} {%s} - {%s} - text: {%s}",
                    item.getNewsID(),
                    item.getSender().value(),
                    item.getStartDate().toString(),
                    item.getCategory().value(),
                    item.getPriority().value(),
                    item.getMessageText());
                news.add(formatter.toString());
            }
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error 
        System.out.println(ex);
    }

    return news;
}

Using Aruba's WsEndUser SetReadNews method you can report News as already read so as to not show it to the user.

Parameters
newsID
Type: int
System.Int32 type value represents the id of the news to be read
senderType
Type: NewsSenderTypes
NewsSenderTypes type value represents the type of sender.

Let's look at an example

//IWsEndUser.SetReadNews Method (c# .NET)
private static void SetReadNews(WsEndUserClient client, int newsID)
{
    try
    {
        //sets the type of sender
        NewsSenderTypes senderType = NewsSenderTypes.Operator;

        //calls the SetReadNews method, getting an WsResult object
        WsResult result = client.SetReadNews(newsID, senderType);

        //if the call fails; it relaunches the error indicating the message
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the generic error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.SetReadNews Method (JAVA)
private static void SetReadNews(IWsEndUser client, int newsID)
{
    try
    {
        //sets the type of sender
        NewsSenderTypes senderType = NewsSenderTypes.OPERATOR;

        //calls the SetReadNews method, getting a WsResult object
        WsResult result = client.setReadNews(newsID, senderType);

        //if the call fails; it relaunches the error indicating the message
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error 
        System.out.println(ex);
    }
}

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