我们正在尝试使用 SOAP UI 通过 PSI 资源 ASMX Web 服务执行更新请求。我们只是使用从 ReadResource 调用获得的相同资源数据集信息执行更新。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://schemas.microsoft.com/office/project/server/webservices/Resource/">
<soapenv:Header/>
<soapenv:Body>
<res:UpdateResources>
<res:rds>
<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<ResourceDataSet xmlns="http://schemas.microsoft.com/office/project/server/webservices/ResourceDataSet/">
<Resources diffgr:id="Resources1" msdata:rowOrder="0">
<RES_UID>a1d7467d-2a6a-4b0c-b36b-78ef5cbe3fdd</RES_UID>
<RES_ID>288</RES_ID>
<RES_TYPE>2</RES_TYPE>
<RES_HAS_NOTES>false</RES_HAS_NOTES>
<RES_CAN_LEVEL>true</RES_CAN_LEVEL>
<RES_ACCRUE_AT>3</RES_ACCRUE_AT>
<RES_BOOKING_TYPE>0</RES_BOOKING_TYPE>
<RES_NAME>Test</RES_NAME>
<RES_INITIALS>T</RES_INITIALS>
<RES_IS_WINDOWS_USER>false</RES_IS_WINDOWS_USER>
<RES_CHECKOUTDATE>2016-02-17T15:36:53.29+00:00</RES_CHECKOUTDATE>
<RES_TIMESHEET_MGR_UID>a1d7467d-2a6a-4b0c-b36b-78ef5cbe3fdd</RES_TIMESHEET_MGR_UID>
<RES_DEF_ASSN_OWNER>a1d7467d-2a6a-4b0c-b36b-78ef5cbe3fdd</RES_DEF_ASSN_OWNER>
<RES_IS_TEAM>false</RES_IS_TEAM>
<RES_EXCHANGE_SYNC>false</RES_EXCHANGE_SYNC>
<CREATED_DATE>2016-02-15T10:52:25.347+00:00</CREATED_DATE>
<MOD_DATE>2016-02-15T10:52:24.673+00:00</MOD_DATE>
<RES_STD_RATE_FMT>2</RES_STD_RATE_FMT>
<RES_OVT_RATE_FMT>2</RES_OVT_RATE_FMT>
<RES_STD_RATE>0.000000</RES_STD_RATE>
<RES_OVT_RATE>0.000000</RES_OVT_RATE>
<RES_MAX_UNITS>10000.000000</RES_MAX_UNITS>
<RES_PREVENT_ADSYNC>false</RES_PREVENT_ADSYNC>
<RES_COST_PER_USE>0.000000</RES_COST_PER_USE>
<BaseCalendarUniqueId>6578a6ed-4cc2-48e1-84a6-02ac9583d5db</BaseCalendarUniqueId>
</Resources>
<ResourceRates diffgr:id="ResourceRates1" msdata:rowOrder="0">
<RES_UID>a1d7467d-2a6a-4b0c-b36b-78ef5cbe3fdd</RES_UID>
<RES_RATE_TABLE>0</RES_RATE_TABLE>
<RES_STD_RATE>0</RES_STD_RATE>
<RES_OVT_RATE>0</RES_OVT_RATE>
<RES_COST_PER_USE>0</RES_COST_PER_USE>
</ResourceRates>
<ResourceAvailabilities diffgr:id="ResourceAvailabilities1" msdata:rowOrder="0">
<RES_UID>a1d7467d-2a6a-4b0c-b36b-78ef5cbe3fdd</RES_UID>
<RES_AVAIL_UNITS>100</RES_AVAIL_UNITS>
</ResourceAvailabilities>
</ResourceDataSet>
</diffgr:diffgram>
</res:rds>
<res:validateOnly>true</res:validateOnly>
<res:autoCheckIn>false</res:autoCheckIn>
</res:UpdateResources>
</soapenv:Body>
</soapenv:Envelope>
我从服务器收到了这个响应。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Server</faultcode>
<faultstring xml:lang="en-US">ProjectServerError(s) LastError=GeneralUnhandledException Instructions: Pass this into PSClientError constructor to access all error information</faultstring>
<detail>
<errinfo>
<general>
<class name="An unhandled exception occurred in Microsoft.Office.Project.Server.BusinessLayer.Resource.UpdateResources.">
<error id="42" name="GeneralUnhandledException" uid="362c7b0b-6b4f-45c2-9b4a-640623dd7560" Exception="System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Office.Project.Server.BusinessLayer.Resource.DataSetHasMsxColumns(ResourceDataSet resourceDataSet)
at Microsoft.Office.Project.Server.BusinessLayer.Resource.UpdateResources(ResourceDataSet rds, Boolean validateOnly, Boolean autoCheckIn)
at Microsoft.Office.Project.Server.Wcf.Implementation.ResourceImpl.UpdateResources(ResourceDataSet rds, Boolean validateOnly, Boolean autoCheckIn)"/>
</class>
</general>
</errinfo>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
例外是通用的,但有人知道这里有什么问题吗?调用的方法没有文档 (DataSetHasMsxColumns),但该名称可能对曾经使用这些服务的人具有暗示性。
提前谢谢你最好的问候