Re: Error updating Financial Summary: Missing required element (653 Views)
Reply
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 1 of 17 (717 Views)

Error updating Financial Summary: Missing required element

Hi all,

 

I´m trying to update a financial summary, but in teh moment when i try to do that i'm getting an error:

 

Internal error has occurred while calling PPM Web Service. Contact PPM Center support with the detailed information if the problem persists. (KNTA-11186) Details: Missing required element {http://mercury.com/ppm/fm/service/1.0}financialSummary

 

Here is the sample code (i'm learning):

 

    public static void main(String[] args) {
        try {
            String strFile = "c:\\xxx.csv";
            BufferedReader br = new BufferedReader(new FileReader(strFile));
            String strLine = "";
            String[] arrLine;
            while ((strLine = br.readLine()) != null) {
                arrLine = strLine.split(";");
                LoadFS(arrLine[0], arrLine[1], arrLine[2], arrLine[3], arrLine[4], arrLine[5], arrLine[6]);
            }
            br.close();
            br = null;
            
        } catch (Exception e) {

        }

    }

//Update Method

 public static void LoadFS(String par1, String par2, String par3, String par4, String par5, String par6, String par7) {
        //call WS

        FinancialSummaryClient fc = new FinancialSummaryClient("http://localhost:8080/itg/ppmservices/FinanceService", "PROPOSAL", new Long(31644), "admin");
        try {
            FinancialSummaryInfo fs = fc.readFinancialSummary();
            System.out.println("Reading...");
            
            fc.updateFinancialSummary(fs);

            System.out.println("Updating...");
        } catch (Exception e) {
            System.out.println("Failure: " + e.getMessage());
        }

    }

//Update FS Method

    protected void updateFinancialSummary(final FinancialSummaryInfo fs) throws RemoteException {
        fs.setName(fs.getName());
	fs.setDescription(fs.getDescription());
	fs.setLocalCurrencyCode(fs.getLocalCurrencyCode());
        fs.setForecastActual(fs.getForecastActual());
        

        final UpdateFinancialSummaryDocument requestDoc = UpdateFinancialSummaryDocument.Factory.newInstance();
        requestDoc.addNewUpdateFinancialSummary().setFinancialSummary(fs);
        FinanceServiceStub stub = null;
        try {
            stub = getStub();
        } catch (Exception e) {

        }
        stub.updateFinancialSummary(requestDoc);
    }

//getStub Method

    public FinanceServiceStub getStub() throws PPMServiceException {
        FinanceServiceStub stub = null;
        try {
            stub = new FinanceServiceStub(context, serviceURL);
            WSSecurityUtil.setHttpBasicAuthHeader(stub, serviceURL);
            return stub;
        } catch (AxisFault e) {
            e.printStackTrace();
        }
        return null;
    }

 

 

I'm trying to update a F.S. without any changes (yet) ... but im getting the error    in the line:

 

stub.updateFinancialSummary(requestDoc);

 

Thanks for you help.

 

OJaraH.

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 2 of 17 (699 Views)

Re: Error updating Financial Summary: Missing required element

I think you are getting NULL FinancialSummaryInfo object.... to validate this just try to print Name and Description in "updateFinancialSummary" method, rest comment the code.

 

fs.getName()

and

fs.getDescription()

 

If you are getting null FSInfo object then you are not reading the Financial Summary properly.

 

FinancialSummaryInfo fs = fc.readFinancialSummary();

 

you need to pass the

 

  1. Service URL
  2. Parent Type
  3. ID

For Example:

public FinancialSummaryInfo readFinancialSummary(String fsServiceURL, String parentType, Long parentId
            ) throws RemoteException 
     {

// again assigning service URL for demo, actaully its not needed
fsServiceURL = "http://localhost:8080/itg/ppmservices/FinanceService";
        final ReadFinancialSummaryDocument requestDoc = ReadFinancialSummaryDocument.Factory.newInstance();
        final ReadFinancialSummary fs = requestDoc.addNewReadFinancialSummary();
        final ParentInfo parent =
                this.populateParentInfo(fs.addNewFinancialSummaryParent(), parentType, parentId);
        final FinanceServiceStub stub = new FinanceServiceStub(this.context, faServiceURL);
        final ReadFinancialSummaryResponseDocument responseDoc = stub.readFinancialSummary(requestDoc);
        final ReadFinancialSummaryResponse response = responseDoc.getReadFinancialSummaryResponse();
        return response.getFinancialSummary();
      }

 

 

 

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 3 of 17 (689 Views)

Re: Error updating Financial Summary: Missing required element

i'm sorry, i forget to show the object returned:

 

<xml-fragment xmlns:service="http://mercury.com/ppm/fm/service/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://mercury.com/ppm/fm/1.0">
<ns:id>32241</ns:id>
<ns:name>31645 - Load Test</ns:name>
<ns:description>test</ns:description>
<ns:parent>
<ns:parentType>PROPOSAL</ns:parentType>
<ns:parentIdentifier>
<ns:id>31645</ns:id>
</ns:parentIdentifier>
</ns:parent>
<ns:localCurrencyCode>CLP</ns:localCurrencyCode>
<ns:baseCurrencyCode>CLP</ns:baseCurrencyCode>
<ns:approvedBudgets/>
<ns:forecastActual>
<ns:id>32241</ns:id>
<ns:isCapexOpexEnabled>false</ns:isCapexOpexEnabled>
<ns:actualRollupCode>MANUAL</ns:actualRollupCode>
<ns:lines/>
<ns:userData/>
<ns:periodSum/>
</ns:forecastActual>
<ns:benefit>
<ns:id>32241</ns:id>
<ns:lines/>
<ns:userData/>
<ns:periodSum/>
</ns:benefit>
<ns:snapshots/>
<ns:npv>0.0</ns:npv>
<ns:tnr>0.0</ns:tnr>
</xml-fragment>

 

apparently is not null... 

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 4 of 17 (669 Views)

Re: Error updating Financial Summary: Missing required element

Generally this error comes when either Entity Type or Entity ID is missing. Can you try again by adding this line after setLocalCurrencyCiode statement.

 

fs.unsetApprovedBudgets();

 

 

I also observe that the log that you have shared is for Proposal ID 31645 whereas you are passing 31644 ID in your code..

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 5 of 17 (664 Views)

Re: Error updating Financial Summary: Missing required element

I tried with the new added line and got the same error, i'm loosign my mind with this trouble...

 

    protected void updateFinancialSummary(final FinancialSummaryInfo fs) throws RemoteException {
        fs.setName(fs.getName());
	fs.setDescription(fs.getDescription());
        fs.unsetApprovedBudgets();
	fs.setLocalCurrencyCode(fs.getLocalCurrencyCode());
        fs.setForecastActual(fs.getForecastActual());
        

        final UpdateFinancialSummaryDocument requestDoc = UpdateFinancialSummaryDocument.Factory.newInstance();
        requestDoc.addNewUpdateFinancialSummary().setFinancialSummary(fs);
        FinanceServiceStub stub = null;
        try {
            stub = obtenerStub();
        } catch (Exception e) {

        }
        stub.updateFinancialSummary(requestDoc);
    }

the error message:

 

org.apache.axis2.AxisFault: Internal error has occurred while calling PPM Web Service. Contact PPM Center support with the detailed information if the problem persists. (KNTA-11186) Details: Missing required element {http://mercury.com/ppm/fm/service/1.0}financialSummary

 

about the identifier... i have to use a new one, becouse the workflow time out service closed the old request.

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 6 of 17 (661 Views)

Re: Error updating Financial Summary: Missing required element

Can you try commenting out this line and then execute it.... Just for testing purpose.

 

 

 fs.setForecastActual(fs.getForecastActual());
Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 7 of 17 (655 Views)

Re: Error updating Financial Summary: Missing required element

Line commented and the error still appearing:

 

    protected void updateFinancialSummary(final FinancialSummaryInfo fs) throws RemoteException {
        fs.setName(fs.getName());
	fs.setDescription(fs.getDescription());
        fs.unsetApprovedBudgets();
	fs.setLocalCurrencyCode(fs.getLocalCurrencyCode());
        //fs.setForecastActual(fs.getForecastActual());
        

        final UpdateFinancialSummaryDocument requestDoc = UpdateFinancialSummaryDocument.Factory.newInstance();
        requestDoc.addNewUpdateFinancialSummary().setFinancialSummary(fs);
        FinanceServiceStub stub = null;
        try {
            stub = obtenerStub();
        } catch (Exception e) {

        }
        stub.updateFinancialSummary(requestDoc);
    }

 =(

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 8 of 17 (653 Views)

Re: Error updating Financial Summary: Missing required element

Can you share code for readFinancialSummary() method...

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 9 of 17 (646 Views)

Re: Error updating Financial Summary: Missing required element

Here is the method:

 

    protected FinancialSummaryInfo readFinancialSummary() throws RemoteException {
        final ReadFinancialSummaryDocument requestDoc = ReadFinancialSummaryDocument.Factory.newInstance();
        final ReadFinancialSummaryDocument.ReadFinancialSummary fs = requestDoc.addNewReadFinancialSummary();

        // Set up parent information.
        final ParentInfo parent
                = this.populateParentInfo(fs.addNewFinancialSummaryParent(), this.parentType, this.parentId);

        // Read the financial summary.
        FinanceServiceStub stub = null;
        try {
            stub = obtenerStub();
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }

        final ReadFinancialSummaryResponseDocument responseDoc = stub.readFinancialSummary(requestDoc);
        final ReadFinancialSummaryResponseDocument.ReadFinancialSummaryResponse response = responseDoc.getReadFinancialSummaryResponse();

        return response.getFinancialSummary();
    }

 

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 10 of 17 (626 Views)

Re: Error updating Financial Summary: Missing required element

[ Edited ]

Can you just try to print fs.getName() in updateFinancialSummary method, rest comment all the code.

 

Secondly can you  check if there is any Mandatory USER DATA field in Forecast Actual Line and Financial Summary. 

 

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Visitor
OsvaldoJaraH
Posts: 2
Registered: ‎08-12-2013
Message 11 of 17 (620 Views)

Re: Error updating Financial Summary: Missing required element

Done...:

 

    protected void updateFinancialSummary(FinancialSummaryInfo fs) throws RemoteException {
        /*
        fs.setName(fs.getName());
        fs.setDescription(fs.getDescription());
        fs.unsetApprovedBudgets();
        fs.setApprovedBudgets(this.addApprovedBudget(fs.addNewApprovedBudgets()));
        fs.setLocalCurrencyCode(fs.getLocalCurrencyCode());
        //fs.setForecastActual(fs.getForecastActual());

        System.out.println("name: "+fs.getName());
        
        /*
        
        UpdateFinancialSummaryDocument requestDoc = UpdateFinancialSummaryDocument.Factory.newInstance();
        requestDoc.addNewUpdateFinancialSummary().setFinancialSummary(fs);
        FinanceServiceStub stub = null;
        try {
            stub = obtenerStub();
        } catch (Exception e) {

        }
        stub.updateFinancialSummary(requestDoc);*/
    }

 And it prints : name: 31645 - Load Test

 

 There aren't required fields in user data related to financial summary.

 

:/

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 12 of 17 (608 Views)

Re: Error updating Financial Summary: Missing required element

Can you try with any other Proposal's Financial summary which has few Cost lines in it.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 13 of 17 (576 Views)

Re: Error updating Financial Summary: Missing required element

Nothing happened,  the error persist. :(

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 14 of 17 (565 Views)

Re: Error updating Financial Summary: Missing required element

I tried to execute your code and the problem is with this statement.

fs.setForecastActual(fs.getForecastActual());

fs.getForecastActual() is not able to properly return the ForecastActualInfo  object.

 

But when I tried the approached that HP has used in the demo code i.e. create a Super Class that handles the Actuals Object updated and then return it ForecastActualInfo object.

 

Instead of creating super class, just try to modify the ForecastActualInfo object and then try to set it.

 

ForecastActualInfo forecastActual = fs.getForecastActual();
ForecastActualInfo.Lines faLines = forecastActual.getLines();
 for (int i = 0; i < faLines.getLineArray().length; i++) {
            
            ForecastActualInfo.Lines.Line.Cells faCells = faLines.getLineArray(i).getCells();
            if (!isEmpty(faCells)) {
                for (int j = 0; j < faCells.getCellArray().length; j++) {
                    FinancialLineCellInfo faCell = faCells.getCellArray(j);
                    
                    if (faCell != null && faCell.getActualValueLCL() != null) {
                        faCell.setActualValueLCL(faCell.getActualValueLCL().multiply(new BigDecimal(1.10)));
                    }
                }
            }
        }
fs.setForecastActual(forecastActual);

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Occasional Advisor
ojarah
Posts: 7
Registered: ‎03-25-2014
Message 15 of 17 (554 Views)

Re: Error updating Financial Summary: Missing required element

I tried  but it didn't work, so the problem is me, can you post the entire code? thanks a lot.

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 16 of 17 (550 Views)

Re: Error updating Financial Summary: Missing required element

Please share your email address.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Visitor
OsvaldoJaraH
Posts: 2
Registered: ‎08-12-2013
Message 17 of 17 (539 Views)

Re: Error updating Financial Summary: Missing required element

i've sent you a private message with the address...

 

thanks a lot again.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.