Soap web service for Deltek Vision

Hello, I am trying to write an application that queries the Deltek web service API for Vision Cloud.  I am able to retrieve results from the web service but only when the data set returned is small.  Can someone please give me some pointers on how to change the following code when the data returned is large?

            string UserID = "user";
            string Password = "password";
            string Domain = "domain.com";
            string DatabaseDescription = "DBDesc";         // from Web link - see doc
            string IntegratedSecurity = "Y";

            com.deltekfirst.name.DeltekVisionOpenAPIWebService proxy = new com.deltekfirst.name.DeltekVisionOpenAPIWebService();

            string ConnInfoXml = @"<VisionConnInfo><databaseDescription>" + DatabaseDescription + @"</databaseDescription>";
            ConnInfoXml += @"<userName>" + UserID + @"</userName>";
            ConnInfoXml += @"<userPassword>" + Password + @"</userPassword>";
            ConnInfoXml += @" <integratedSecurity>" + IntegratedSecurity + @"</integratedSecurity>";
            ConnInfoXml += @"</VisionConnInfo>";

            string RecordDetail = "Primary";

            proxy.UseDefaultCredentials = true;
            proxy.Credentials = new NetworkCredential(UserID, Password, Domain);
            proxy.Timeout = 600000;

            string WSResponse = proxy.GetProjectsByQuery(ConnInfoXml, "Select PR.* From PR", RecordDetail);

            MessageBox.Show(WSResponse);

Open in new window


The issue I run into is when the query "Select PR.* From PR" does not narrow down the result set with a Where clause the application errors out with code 529.  Once I narrow down the results it will return values and work as expected.  Is there some way to stream the results back or use paging to get xml records one at a time?
craigbtgAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
>> or use paging to get xml records one at a time
Ideally you would get a "bunch" at a time, not one at a time.  I couldn't find the API documentation online, if you have an API document, see if there is some sort of "LIMIT" clause (similar to MySQL).  The idea is to emit a query like:
"Select PR.* From PR LIMIT x, y"

where "x" is the starting row, and "y" is the total number of rows for the current query.  So, for example:
"Select PR.* From PR LIMIT 0, 100" would get you the first 100 records
"Select PR.* From PR LIMIT 100, 100" would get you the next 100 records

you would to stop if you get less than 100 records, since you were requesting 100 at a time.
craigbtgAuthor Commented:
Thanks hielo, meant to update this.  The API does not have anything to limit the results, even a "select top 100 * from PR" does not limit the returned records.  Fortunately, it turned out the problem described was due to the MessageBox display and had nothing to do with the data results.  I'm not sure why no error was being thrown when the results couldn't be displayed in the messagebox but once that was removed everything worked even with large results.  The code seems to be working as expected.  Hopefully someone else working with the Vision API will find it useful.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hieloCommented:
Understood.  In case you are interested in looking into paging abilities, read on.

>> The API does not have anything to limit the results,
On your code you are using "GetProjectsByQuery(ConnInfoXML, Query, RecordDetail)" which is an  Info Center-specific API.

Have you tried using the Generic API:
GetRecordsByQuery(ConnInfoXML, InfoCenterXML, QueryXML, RecordDetail)

If I understood the manual correctly, in the InfoCenterXML you should be able to specify the Chunk and ChunkSize when you emit your query:


Chunk — This is optional. This is a numeric field for
requesting data in “chunks.” It represents which chunk of
data is being requested.

ChunkSize — This is optional. This is a numeric attribute
that sets the number of records to be returned with the
current chunk. The number of records returned may be less

Deltek VisionXtend™ 7.3
Web Services and APIs for Deltek Vision

Regards,
Hielo
craigbtgAuthor Commented:
Remove the MessageBox line and this code will work.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Services

From novice to tech pro — start learning today.