readPortfolio

Purpose

This operation reads the details of an existing portfolio specified by its name or ID.

Function

By specifying the name of ID of a portfolio, you can use this operation to retrieve all the details of the portfolio, including managers, child portfolios, programs and proposals/project and assets that belong to this portfolio.

Related Information

The following related operation:

Input

One of the following field is required:

  • The portfolio ID

  • The portfolio name

Return

A PortfolioWSBean object which includes all the details of the portfolio.

Java Interface

ReadPortfolioResponseDocument
readPortfolio(ReadPortfolioDocument in)

Parameters

Description

ReadPortfolioDocument

Wrapper for the input of this operation.

See the Java example for construction.

One of the following fields in the bean is required:

  • Long id

  • String name

ReadPortfolioResponseDocument

Wrapper for the PortfolioWSBean retrieved by performing this operation.

Java Examples

public Portfolio testReadPortfolio(String portfolioName) throws
Exception {
       System.out.println("testReadPortfolio started ...");
       PortfolioServiceStub stub = new
PortfolioServiceStub(ctx, WSURL);
       ReadPortfolioDocument readPortfolioDocument =
ReadPortfolioDocument.Factory.newInstance();
       ReadPortfolio readPortfolio =
readPortfolioDocument.addNewReadPortfolio();
       ReadPortfolioInput portfolioInput =
readPortfolio.addNewPortfolio();
       portfolioInput.setName(portfolioName);
       ReadPortfolioResponseDocument response =
stub.readPortfolio(readPortfolioDocument);
       Portfolio portfolio =
response.getReadPortfolioResponse().getPortfolio();
       System.out.println("Read Portfolio " +
portfolio.getName() + " with id " + portfolio.getId());
       System.out.println("testReadPortfolio completed");
       return portfolio;
}

Errors and Exceptions

When an error occurs on this operation, you will see a description of the root cause in the server log or in the response message:

The server log content is similar to the following:

Exception in thread "main" org.apache.axis2.AxisFault:
<exception:exceptionDetails xmlns:exception="http://
www.mercury.com/ppm/ws/exception">
<exception:detail>[root cause description] </exception:detail>
</exception:exceptionDetails>

Possible root cause descriptions:

Message Code

Message

Cause(s)

Possible Corrective Action

exception.authorization

You do not have the privilege to take this action. Please consult your PPM Administrator.

You are not authorized to create a portfolio.

Check the user licenses and privileges (access grants)

com.mercury.itg.exceptions.ObjectNotFoundException

Cannot load the {0} with the specified id: {1}. {0} may be deleted by another user.

A portfolio with the specified name or ID cannot be found.

Check the portfolio name or ID.