Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

[Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

Highlighted
hyllplan
Frequent Visitor

[Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

Hi,

Im trying to use web services to update Financials. It works if I execute my javaclass using compile_client.bat from the windows server hosting PPM.

However when trying to run the code from eclipse I get the following error:

Any idea?

 

<< Reading financial summary of PROJECT with ID=30768 >>

Exception in thread "main" org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not contain required Security header

at org.apache.axis2.description.OutInAxisOperationClient.send(

OutInAxisOperation.java:271)

at org.apache.axis2.description.OutInAxisOperationClient.execute(

OutInAxisOperation.java:202)

at com.mercury.itg.ws.fm.client.FinanceServiceStub.readFinancialSummary(

FinanceServiceStub.java:2231)

at johan.test.ActualClient.readFinancialSummary(

ActualClient.java:316)

at johan.test.ActualClient.doRun(

ActualClient.java:276)

at johan.test.ActualClient.main(

ActualClient.java:135)

4 REPLIES
Kerim KILIC
Frequent Visitor

Re: [Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

private void setHttpBasicAuthHeader(Stub stub) {
        Options options = new Options();
        HttpTransportProperties.Authenticator auth = new
            HttpTransportProperties.Authenticator();
        auth.setUsername("ppmusr"));
        auth.setPassword("ppmpass"));
        auth.setPreemptiveAuthentication(true);
        options.setProperty(HTTPConstants.AUTHENTICATE, auth);
        options.setTo(new EndpointReference(WSURL));
        stub._getServiceClient().setOptions(options);
    }

hyllplan
Frequent Visitor

Re: [Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

Thanks Kerim.

That seems to work to some extent. I dont want to mark this as solved yet, though;). I give you a kudo:)

 

I do manage to use your code to authenticate me properly. But at a specific point in the code Eclipse does not want  to play anymore:)

 

I get this error:

 

Exception in thread "main" 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

           at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271)

           at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)

           at com.mercury.itg.ws.fm.client.FinanceServiceStub.updateFinancialSummary(FinanceServiceStub.java:328)

           at johan.test.ActualClient.updateFinancialSummary(ActualClient.java:183)

           at johan.test.ActualClient.doRun(ActualClient.java:312)

           at johan.test.ActualClient.main(ActualClient.java:145)

 

// It is caused by (code in bold causing error):

 

 

UpdateFinancialSummaryDocument requestDoc = UpdateFinancialSummaryDocument.Factory.newInstance();

 

        requestDoc.addNewUpdateFinancialSummary().setFinancialSummary(fs);

 

 

        FinanceServiceStub stub = new FinanceServiceStub(context, serviceURL);

 

        this.setHttpBasicAuthHeader(stub, serviceURL);

 

        stub.updateFinancialSummary(requestDoc);

 

 

 

// Below is setHttpBasicAuthHeader that Ive used. user/password is of course handled

// accordingly

 

 

privatevoid setHttpBasicAuthHeader(Stub stub, String serviceURL) {

 

    Options options = new Options();

 

    HttpTransportProperties.Authenticator auth = new

 

        HttpTransportProperties.Authenticator();

 

    auth.setUsername("user");

 

    auth.setPassword("pass");

 

    auth.setPreemptiveAuthentication(true);

 

    options.setProperty(HTTPConstants.AUTHENTICATE, auth);

 

    options.setTo(new EndpointReference(serviceURL));

 

    stub._getServiceClient().setOptions(options);

 

}

 

 Idea?

 

 

Kerim KILIC
Frequent Visitor

Re: [Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

hmm i didnt work with financial summary webservices, but for webservices you need to parse parameters like you opening financial summary from web ui. please check wheter you are parsing same parameters like you opening on web ui. it looks like you are missing a parameter like periods, region etc.
penoles
Regular Collector

Re: [Web Services] WSDoAllReceiver: Incoming message does not contain required Security header

since you do update operation to financial summary, I suggest you first read the fs object through web services  and then do update base on this fs object.Thus you would not missing any fs info 

//Add this to "OnDomLoad" event