PSI access from Java client

A

Ali Aziz

Has anyone been able to access PSI from a Java client?

For testing, we're using the Microsoft EPM 2007 virtual image that has
everything preinstalled (project and portfolio server, sql server, sharepoint
services, project professional etc.).

We're using a SOAP testing tool called soapUI (built in Java using Apache
Axis2 webservices API) to make test calls to the PSI. However, all responses
we get for seemingly successful calls are empty bodies. We think we're making
successful calls because we get errors in case we pass incorrect parameters.
For example, if we send the following request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:proj="http://schemas.microsoft.com/office/project/server/webservices/Project/">
<soap:Header/>
<soap:Body>
<proj:ReadProjectStatus>
<proj:projGuid>ceee4f03-2e15-4458-bb18-07c91f92586b</proj:projGuid>
<proj:dataStore></proj:dataStore>
</proj:ReadProjectStatus>
</soap:Body>
</soap:Envelope>

The response is:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Server was unable to read request. --->
There is an error in XML document (6, 43). ---> Instance validation error: ''
is not a valid value for DataStoreEnum.</soap:Text>
</soap:Reason>
<soap:Detail/>
</soap:Fault>
</soap:Body>
</soap:Envelope>

If we correct the request and use a valid value for the DataStoreEnum i.e.:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:proj="http://schemas.microsoft.com/office/project/server/webservices/Project/">
<soap:Header/>
<soap:Body>
<proj:ReadProjectStatus>
<proj:projGuid>ceee4f03-2e15-4458-bb18-07c91f92586b</proj:projGuid>
<proj:dataStore>PublishedStore</proj:dataStore>
</proj:ReadProjectStatus>
</soap:Body>
</soap:Envelope>

We get a response with an empty body i.e.:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ReadProjectStatusResponse
xmlns="http://schemas.microsoft.com/office/project/server/webservices/Project/"/>
</soap:Body>
</soap:Envelope>

The same hold true for various other operations we have tried e.g.:
ReadProjectList:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ReadProjectListResponse
xmlns="http://schemas.microsoft.com/office/project/server/webservices/Project/"/>
</soap:Body>
</soap:Envelope>

Any idea what may be going on? Has anyone successfully called PSI from java
clients?

Regards,

--Ali
 
S

Stephen Sanderlin

The PSI should be usable by any SOAP compliant consumer.

In this specific case, please try putting a 1 in the <proj:dataStore>
element instead of PublishedStore.

This parameter is an Enumeration, which means you need to convert it
into the underlying value for the enumeration member when calling:
http://msdn.microsoft.com/en-us/library/websvcproject.datastoreenum.aspx

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
A

Ali Aziz

Hi Stephen,

Thanks for the reply. I've replaced the value with 0, 1, 2, 3 as specified
in the link you provided. Here is a request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:proj="http://schemas.microsoft.com/office/project/server/webservices/Project/">
<soap:Header/>
<soap:Body>
<proj:ReadProjectStatus>
<proj:projGuid>ceee4f03-2e15-4458-bb18-07c91f92586b</proj:projGuid>
<proj:dataStore>1</proj:dataStore>
</proj:ReadProjectStatus>
</soap:Body>
</soap:Envelope>

And corresponding response:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Server was unable to read request. --->
There is an error in XML document (6, 44). ---> Instance validation error:
'1' is not a valid value for DataStoreEnum.</soap:Text>
</soap:Reason>
<soap:Detail/>
</soap:Fault>
</soap:Body>
</soap:Envelope>

Am I perhaps missing some security/permissions settings on my VM image?

Regards,

--Ali
 
S

Stephen Sanderlin

Hm... looking through the schema definition, it appears that this
particular wants the text values, not the underlying numeric values...
Strange that this method wants the string values and other methods want
the numeric values...

Let's try something else. It looks like soapUI supports NTLM
authentication, no? (http://www.soapui.org/userguide/requests.html) If
this is correct, does the user you are authenticating as have
permissions to view any projects?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
A

Ali Aziz

Well, we're using the following credentials:

username: Administrator
password: pass@word1

And we're able to see all projects via the Project Center (open them up in
MS Project, checkthem out, check them back in, publish etc. etc.) However, I
should point out that we don't have MS Project Server skills so can we make
sure that we have the right permissions?

Also, on further investigation, the "empty" body of the SOAP response does
have headers sent back from the project server and the response code is 401
unauthorized! We reconfirmed this behaviour by writing our own Java client to
make the webservice call via a POST method and our status code is also 401
and NTLM authentication fails. However, and this is the interesting part, if
we make a GET call to retrieve the WSDL document and authenticate via NTLM
(using same credentials) it succeeds and we get a 200 response.

Does this mean that the server is not allowing POST methods?

Regards,

--Ali
 
S

Stephen Sanderlin

If you're able to do all of that in PWA and ProjPro, you should have
sufficient permissions. I have also confirmed that you should be using a
POST method.

Try this:
1) In SharePoint Central Admin, go to "Application Management" and click
"Manage this Farm's Shared Services".
2) Hover over the SSP's name
3) Click the drop-down arrow that appears to the right of the SSP's name
4) Click "Edit Properties"
5) Scroll to the bottom of the "Edit Shared Services Provider" page
6) Enter the user's ID into the "Process Accounts with access to this
SSP" box
7) Click the "OK" button

Let me know if that helps.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
A

Ali Aziz

Hi Stephen,

I have added the "farmadmin" user but still no luck. Like I mentioned
earlier, I'm doing two programmtic calls:

1) GET to retrieve the WSDL file: succeeds authenticating via NTLM get a 200
response
2) POST to invoke webservices operation: fail to authenticate - 401
unauthorized

Can't figure out why one call succeeds and the other fails with the same
credentials?

Regards,

--Ali
 
S

Stephen Sanderlin

S

Stephen Sanderlin

So, I downloaded a copy of soapUI Pro 2.5.1 and ran it... I was able to
connect properly to my production Project PSI when I correctly entered
the NTLM authentication information in the request screen.

The only "weirdness" I found was that I had to put the domain in the
domain box, not in the username box in the form "domain\username"... You
said you added farmadmin to the process account list for the SSP, but
earlier you said you were logging in as administrator... try logging in
as farmadmin in soapUI.

Other than that, I don't know what else to tell you, unfortunately... I
cannot reproduce your issue.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 

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