Project and Portfolio Management Practitioners Forum
cancel

Financial WS Question

Highlighted
AlfredoMonasi
Honored Contributor.

Financial WS Question

Hi everyone,

 

I'm trying to use the WS for recover and update Financial Summar Data, but I'm having some troubles when defining the financialDataParentInfo object value of token. I'm using KNTA_FINANCIAL SUMMARY and REQ.FINANCIAL SUMMARY with the request number but I'm having a error that can't find the financial data of the token X of the request id number Y.

 

Can anyone give me a hand of that token use.

 

Code below.

 

Regards,

 

Alfredo

 

 

[WebMethod]
    public financialDataInfo leerFinancialData(String requestID,String tokenFS)
    {
        try
        {
            String decryptUsu = String.Empty;
            sec.SimpleDecrypt(ConfigurationManager.AppSettings["userPPM"].ToString(), ref decryptUsu);

            String decryptPas = String.Empty;
            sec.SimpleDecrypt(ConfigurationManager.AppSettings["passPPM"].ToString(), ref decryptPas);

            financeServiceWS = new FinanceServiceWse();
            UsernameOverTransportAssertion policyAssertion = new UsernameOverTransportAssertion();
            // setup WS-Security credentials
            policyAssertion.UsernameTokenProvider = new UsernameTokenProvider(decryptUsu, decryptPas);
            Policy policy = new Policy(policyAssertion);
            financeServiceWS.SetPolicy(policy);

            readFinancialData rfd = new readFinancialData();
            fdpi = new financialDataParentInfo();
            fdpi.parentId = requestID;
            fdpi.parentType = financialDataParentInfoParentType.REQUEST;
            fdpi.token = tokenFS;
            rfd.financialDataParent = fdpi;
            readFinancialDataResponse rfdr = financeServiceWS.readFinancialData(rfd);

            return rfdr.financialData;
        }
        catch (Exception e) {
            throw new Exception("ERROR: " + e.Message);
        }
    }