"System.Web.Services.Protocols.SoapException: ProjectServerError

M

manoj

HI,

When i try to call ReadResource() method on resource datatable no problem
occurs.
But I am getting the following exception when i am trying to access
resource.readresource() method on ResourceCustomFields datatable.

ex = {"System.Web.Services.Protocols.SoapException: ProjectServerError(s)
LastError=GeneralUnhandledException Instructions: Pass this into
PSClientError constructor to access all error information\n at
Microsoft.Office.Project.Server.WebService.Resource.ReadReadResources(xmlfilter,false)

I am using windows authentication.


I am not getting what could be the possible reason for this??

thanks in advance
 
B

Brian Smith \(MSFT\)

Hi Manoj,

The resource.ReadResource() will return a resource dataset which will
contain both a datatable for resources and resourcecustomfields - so it
isn't necessary or possible to use the call in the way you describe. The
resourcecustomfields datatable may or may not contain any rows as the
dataset does not populate rows until a particular field has a value set.

Hope this helps.

Brian.
 
M

manoj

thanks for replying back brian...
My requirement is to have few columns like RES_NAME(resource
names),WRES_Account(resource email id) which belongs to resource table along
with some custom fields which are part of ResourceCustomFields table.

i tried doing it 2 ways:

1) There is a method Readresources() which takes an xml filter and a bool
type as an input paramater. In xml filter we can specify the table name(i
specified Resource table name) and its columns which we want. When i run
Resource.Readresources(xmlfilter,false) i get a ResourceDataset back which
carries the resource table.

In order to get ResourceCustomFields table i used the xmlfilter specifying
ResourceCustomFields table as the table name and few columns and then ran the
same function resource.Readresources(xmlfilter.false). But this time it gives
me the exception which i already specified in my question.


2)The second way tried is :
i ran resource.readresources() method for resource table and got RES_UID as
a column name. Then i ran resource.Readresource(RES_UID) passing RES_UID as
parameter to it. This gives me dataset for ResourceCustomFields datatable.
So using Resource.Readresources() method i can find RES_UID for all users
and pass RES_UID as a paramater to Readresource() method to find custom field
columns. Only problem here is that i have a huge list of 1000 users in ERP
and for every user passing its RES_UID column to ReadResource() method takes
very long time .

Do you have any solution for any of the two methods i tried or if you can
provide any other soln that wud be highly appreciated.

Sorry to keep you bugging....
 
B

Brian Smith \(MSFT\)

OK, I understand now. Your initial posting said you were using ReadResource
not ReadResources. You can set xml filters that cover both datatables with
one call. I don't have an example to hand for the ReadResources but this
one for Readcalendars should help where I read both the calendars and
CalendarExceptions tables:-

string tableNameCal = dsCalendar.Calendars.TableName;
string tableNameEx = dsCalendar.CalendarExceptions.TableName;
string nameColumnCal =
dsCalendar.Calendars.CAL_NAMEColumn.ColumnName;
string uidColumn =
dsCalendar.CalendarExceptions.CAL_UIDColumn.ColumnName;
string nameColumnEx =
dsCalendar.CalendarExceptions.NameColumn.ColumnName;
string startColumn =
dsCalendar.CalendarExceptions.StartColumn.ColumnName;
string finishColumn =
dsCalendar.CalendarExceptions.FinishColumn.ColumnName;
string shift1StartColumn =
dsCalendar.CalendarExceptions.Shift1StartColumn.ColumnName;
string shift1FinishColumn =
dsCalendar.CalendarExceptions.Shift1FinishColumn.ColumnName;
string shift2StartColumn =
dsCalendar.CalendarExceptions.Shift2StartColumn.ColumnName;
string shift2FinishColumn =
dsCalendar.CalendarExceptions.Shift2FinishColumn.ColumnName;
string recurrenceType =
dsCalendar.CalendarExceptions.RecurrenceTypeColumn.ColumnName;

calFilter.FilterTableName = dsCalendar.Calendars.TableName;
calFilter.FilterTableName =
dsCalendar.CalendarExceptions.TableName;
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameCal,
nameColumnCal));
calFilter.Fields.Add(new
PSLibrary.Filter.Field(tableNameEx,uidColumn));
calFilter.Fields.Add(new
PSLibrary.Filter.Field(tableNameEx,nameColumnEx));
calFilter.Fields.Add(new
PSLibrary.Filter.Field(tableNameEx,startColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
finishColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
shift1StartColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
shift1FinishColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
shift2StartColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
shift2FinishColumn));
calFilter.Fields.Add(new PSLibrary.Filter.Field(tableNameEx,
recurrenceType));

dsCalendar = calendar.ReadCalendars(calFilter.GetXml(), false);

Best regards,

Brian Smith
http://blogs.msdn.com/brismith

For
 
M

manoj

Hi Brian,

I really appreciate your efforts..thnks a lot...

i tried you way..but its giving invalid filter exception... Even when i used
the xml filter for only ResourceCustomfield datatable i am getting same
invalid filter exception. And when i use Resource datatable as the only
filter table name, i am able to fetch all records belonging to resource
table.

the following link also shows that readresources method can only give
enterprise fields, not the custom fields.

http://msdn2.microsoft.com/en-us/library/websvcresource.resource.readresources.aspx



Thanks again brian for all the hard work you doing :)


This makes me believe that we can fetch only the Resource table values using
ReadResources method. In order to fetch ResourceCustom table we need to use
ReadResource method but that is taking too much time for me as i already
mentioned earlier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top