0

我正在尝试通过 Oracle 的 Web API 连接到 Oracle Primavera。不幸的是,没有太多关于它的文档。我已将 Primavera Web 服务添加到我的项目中。

到目前为止,我有以下代码:

    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

在 authService.Login 中,我收到“请求中缺少 WSS 标头。无法进行用户名令牌身份验证。”

在 Primavera 中,我将身份验证模型设置为 cookie,但没有结果。什么不见​​了?

4

2 回答 2

0

在 Primavera 中,我将身份验证模型设置为 cookie,但没有结果。什么不见​​了?

重新启动 Primavera Web 服务。

于 2015-06-27T09:40:26.450 回答
0

我遇到了同样的错误:“请求中缺少 WSS 标头。无法进行用户名令牌身份验证。” 我做了: Primavera P6 管理员 - Primavera P6 配置 - Web 服务 - 安全 - 身份验证 - 模式 - Cookie。

我在 Delphi 上的代码开始运行。

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;

PS Web 服务和软件安装在我的笔记本电脑上

于 2015-06-29T13:16:38.450 回答