0

I'm trying to connect to Oracle Primavera via Oracle's Web API. Unfortunately there is not much documentation about it. I have added Primavera Web Service into my project.

So far I have following code:

    Dim authService As New AuthenticationService.AuthenticationService

    Dim loginObj As New AuthenticationService.Login()
    Dim loginResponse As AuthenticationService.LoginResponse

    authService.CookieContainer = New System.Net.CookieContainer()
    authService.Url = "http://" + hostName + ":" + port + "/p6ws/services/AuthenticationService"

    loginObj.UserName = userName
    loginObj.Password = passwd
    loginObj.DatabaseInstanceId = 1
    loginObj.DatabaseInstanceIdSpecified = True


    cookieContainer = authService.CookieContainer

    loginResponse = authService.Login(loginObj)
    Return loginResponse.Return

In authService.Login I receive "WSS header is missing from request. Can't do username token authentication."

In Primavera I have set the authentication model to cookie, but no results. What is missing?

Özkan T.
  • 49
  • 4

2 Answers2

0

In Primavera I have set the authentication model to cookie, but no results. What is missing?

Restart Primavera Web Service.

0

I had the same error: "WSS header is missing from request. Can not do username token authentication." I did: Primavera P6 Administrator - Primavera P6 Configuration - Web Services - Security - Authentication - Mode - Cookies.

And my code on Delphi began to run.

var
  i: integer;
  projLoad: CreateProjects;
  projList: ProjectPortType;
  projFieldLoad: Array_Of_ProjectFieldType;
  _login: Login;
  loginReturn: LoginResponse;
  servicePort: AuthenticationServicePortType;
  projectServicePort: ProjectPortType;
  _status: Status;
begin
  SetLength(projFieldLoad, 6);
  projFieldLoad[0] := ProjectFieldType.ObjectId;
  projFieldLoad[1] := ProjectFieldType.Id;
  projFieldLoad[2] := ProjectFieldType.Name_;
  projFieldLoad[3] := ProjectFieldType.StartDate;
  projFieldLoad[4] := ProjectFieldType.FinishDate;
  projFieldLoad[5] := ProjectFieldType.Status;

  servicePort := GetAuthenticationServicePortType();
  _login := Login.Create;
  _login.UserName := 'admin';
  _login.Password := 'admin';
  loginReturn := servicePort.Login(_login);
  projectServicePort := GetProjectPortType();
  projLoad := projectServicePort.ReadProjects(projFieldLoad, '', '');
  for i := 0 to Length(projLoad) - 1 do
  begin
    ShowMessage(IntToStr(projLoad[i].ObjectId));
    ShowMessage(projLoad[i].Id);
    ShowMessage(projLoad[i].Name_);
    if Assigned(projLoad[i].StartDate) then
      ShowMessage(DateToStr(projLoad[i].StartDate.AsDateTime));
    if Assigned(projLoad[i].FinishDate) then
      ShowMessage(DateToStr(projLoad[i].FinishDate.AsDateTime));
    _status := projLoad[i].Status;
    if _status = Status.Planned then
      ShowMessage('Planned');
    if _status = Status.Active then
      ShowMessage('Active');
  end;

P.S. Web services and software installed on my laptop