Which Instance?

G

Guest

Hello Everyone,

A project server extension is accessible by any project
server instance configured on the server.

If a method in the project server extension is designed
to return data stored in a project server instance, how
does the method determine which instance the method
call was intended for?

For example if I have a server named ProjectServer with
two project server instances configured (PWA, PWB), when
a method is called in my PSI extension, how would the
extension tell if the call was made by a user on instance PWA
or a user on PWB?

Bob
 
D

David Kitchen

When you create the Web Service instances you provide a Url to the Web
Service, as these reside below the PWA path it denotes the instance that you
wish to work against.

For example these are the Urls for the Project PSI Web Service for instances
PWA and PWB:

http://servername/PWA/_vti_bin/psi/Project.asmx

http://servername/PWB/_vti_bin/psi/Project.asmx

Asking the Published Projects against the PWA Url will only return answers
against the PWA Published store. And similarly asking the same question
against the PWB PSI Url will only return answers from the PWB stores.

And that's it... change the Url when you create your PSI call and you change
which instance you're looking at.
 
G

Guest

Hello David,

Thank you for your response!

Yes, I agree. From the client's perspective it is simple. If you want
data from the PWA instance you use the PWA URL and for the PWB instance
you use the PWB URL.

However when I create a PSI extension called MyExtension and install it
on the server that hosts both the PWA abd PWB instance, there is only
one copy of MyExtension running. So the question is when I write the
MyExtension service, how do I tell which URL the incoming method call
was sent to?

Does my question make any sense to you?

Bob
 
G

Guest

Ok, I figured it out...

The following code is straight out of the SDK:

// Get the user context of the calling user
HttpContext context = HttpContext.Current;
string pjAuthHeader = context.Request.Headers["PjAuth"];
PSLibrary.PSContextInfo contextInfo =
PSLibrary.PSContextInfo.DeserializeFromString(pjAuthHeader);

The SiteGuid property of resulting contextInfo object
contains the site guid for the project server instance
the calling client used to call the web service.

Bob
 

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