zoukankan      html  css  js  c++  java
  • PWA PSI statusingclient.UpdateStatus更新任务页面的AssnCustomFields的TextValue值

    1、注意Changesxml格式和下面一定要一样
    2、CustomFieldGuid和CustomFieldName都不能少,自定义域的uid和name其中uid或者是MD_PROP_UID_SECONDARY,CustomFieldGuid和自定义域的CustomFieldGuid不一样
    3、摸索老长时间才OK,不易呀
             

    StatusingSvc.Statusing statusingclient = new StatusingSvc.Statusing(); statusingclient.Url = "http://localhost:8888/PWA/_vti_bin/psi/Statusing.asmx"; statusingclient.Credentials = new NetworkCredential("spadmin13", "123456", "spdev.com"); StatusingSvc.StatusingDataSet statu_dst = statusingclient.ReadStatus(new Guid("bac28f5b-2bda-e511-82f5-463500000031"), DateTime.MinValue, DateTime.MaxValue); StatusingSvc.StatusingDataSet.AssnCustomFieldsDataTable ass_cus_tb = statu_dst.AssnCustomFields; //ass_cus_tb[0].TEXT_VALUE = "hello"; string xmldate = @"<Changes> <Proj ID=""49e853c7-2bda-e511-82f5-463500000031""> <Assn ID=""bac28f5b-2bda-e511-82f5-463500000031""> <SimpleCustomFieldChange CustomFieldType=""Text"" CustomFieldGuid=""fc30a9b1-2cda-e511-812a-00155d710610"" CustomFieldName=""交付物完成情况"">hello123</SimpleCustomFieldChange> </Assn> </Proj> </Changes>"; statusingclient.UpdateStatus(xmldate);

    上面的代码有点问题出现一个错误
    Services.Protocols.SoapException: ProjectServerError(s) LastError=GeneralSecurityAccessDenied Instructions: Pass this into PSClientError constructor to access all error information
    
    
    缺少resourceuid
    
    
    <Changes>
    
    
        <Proj ID="49e853c7-2bda-e511-82f5-463500000031">
    
    
            <Assn ID="3f1b99c5-a8ec-e511-82fe-68f7288204f4" ResID="99d92f87-a7ec-e511-812f-00155d710610">
    
    
                <SimpleCustomFieldChange CustomFieldType="Text" CustomFieldGuid="fc30a9b1-2cda-e511-812a-00155d710610" CustomFieldName="交付物完成情况">100%</SimpleCustomFieldChange>
    
    
            </Assn>
        </Proj>
    </Changes>
     
  • 相关阅读:
    sqlserver服务 正在挂起更改,导致无法打开或者停止服务
    menuStrip与toolStrip的使用
    sqlDataCommandBuilder为dataGridView自动生成增删改代码时报错
    visual studio属性面板解释文字看不见
    窗体句柄 控件句柄
    form窗体show不出来
    TextBox密码框变文本框,文本框变密码框
    DataSet数据集手动添加一行记录
    Anaconda3-更换为清华源后依旧报错CondaHTTPError: HTTP 000 CONNECTION FAILED
    Kali Linux 国内源
  • 原文地址:https://www.cnblogs.com/systemnet123/p/5239198.html
Copyright © 2011-2022 走看看