none
PSI 2010 SOAP Resource Web Services - Update Resources Error RRS feed

  • Question

  • Hello Community, 

    We are trying to use SOAP UI to perform an update request using PSI Resource ASMX Web Services. We are simply performing an update with the same resource dataset information obtained from the ReadResource call. 

    <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>

    The server responds with the following error: 

    <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>


    The exception is generic but does anyone know what can be wrong here? the method called has no documentation (DataSetHasMsxColumns) but the name might be suggestive to someone used to work with the services.

    Thank you in advance

    Best Regards



    Monday, March 14, 2016 12:34 PM

All replies

  • Hi there,

        The error you show above occurs when the server is trying to check for the presence of certain columns in the DataSet you supplied (RES_CAL_OOF_EXCHANGE_SYNC and RES_EXCHANGE_EWS_URL).  It shouldn't crash at this point which suggests that there is a problem with the Resource DataSet object you have supplied to the API.

    I would suggest you ensure that you are using the appropriate .NET libraries to supply the serialization of the changes you are attempting.  Doing this via text manipulation is prone to error as the DataSet is a complex object with particular ways of storing changed rows as well as the originals.

    Good luck,

       James.


    James Boman BSc. MCP:EAD

    • Proposed as answer by James Boman Wednesday, June 7, 2017 7:42 PM
    Tuesday, March 15, 2016 2:05 AM
  • Hello James, 
    Thank you for your help. 

    In my current business scenario im actually trying to invoke the web services from an Java Application using Apache CXF. I'm just doing in SOAP UI to guarantee that the payload i'm sending is the same as the one i'm receiving (without any interferance from a Java Transformation). 

    The two columns you mentioned are not in the payload, not even when i call the Read Resources method to read the resource data set. 

    I guess i will have to look around to check if there is any Java Library to manipulate the data sets correctly or i will have to fill the values manually somehow.

    Thank you

    Best regards, 

    Tuesday, March 15, 2016 11:59 AM
  • Filipe,

       Yes, simply returning the payload you got after having changed it is unlikely to be correct.  Using .NET/Mono is recommended.

    Obviously the 2010 software is very old - in 2013 MS added CSOM, JSOM and REST interfaces to make this kind of activity easier.

    Cheers,

       James.


    James Boman BSc. MCP:EAD

    Tuesday, March 15, 2016 10:10 PM
  • Hi Filipe

    I am facing exact same error in my Soap request.

    It will be really very helpful if you can share your resolution for this issue.

    Thanks in advance.


    Best Regards, Somnath

    Wednesday, June 7, 2017 5:49 PM