SOAP format for request into PDS

T

tlorek

I am trying to access our Project Server 2003 via the PDS from Oracle via
their UTL_HTTP package. Having said that, I don't need help with anything
Oracle. What I need is help with SOAP formatting. The PDS documentation is
very weak in this area. Caveat...I am a noob in regards to SOAP and XML.
I've been struggling with this all week and can't get it figured out. I
think I'm close, though...

I've already written the code to log in via LgnPSAu.asp and retrieving the
cookie provided, I'm now trying to call SoapXMLRequest, and can't seem to get
the SOAP message constructed in a manner that PDS will accept.

Here is what I'm sending...

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<SOAP-ENV:Body>
<CMain.SOAPXMLRequest xmlns="http://tempuri.org/message"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sCookie xsi:type="xsd:string">
******very long cookie value taken out for brevity*****
</sCookie>
<sXML xsi:type="xsd:string">
<Request><ProjectData><ProjectID>149</ProjectID></ProjectData></Request>
</sXML>
</CMain.SOAPXMLRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Since the documentation isn't clear as to what http link should have the
SOAP request sent to, I've tried sending the SOAP request to the following:

http://servername/projectserver/logon/PDSRequest.asp

The return I get from this is:

<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a
HREF="../lgnint.asp?DefPage=/projectserver/logon/PDSRequest.asp">here</a>.</body>

If I use that link...

http://servername/projectserver/logon/lgnint.asp?DefPage=/projectserver/logon/PDSRequest.asp

I get a 401.2 error, the gist of which is...

<h1>You are not authorized to view this page</h1>
You do not have permission to view this directory or page using the
credentials that you supplied because your Web browser is sending a
WWW-Authenticate header field that the Web server is not configured to accept.

My questions are...
1. Is my SOAP request set up properly?
2. What link do I point the SOAP request to?

The closest thing I could find that explains this whole process (albeit
somewhat confusing...) is a Cold Fusion interface document, but it mentions
you need to hit:
LgnPSAu.asp
then SesStart.asp with the cookie from LgnPSAu.asp,
then LgnPSAu.asp again,
then you can call SOAPSMLRequest

It's located at:
http://coldfusion.sys-con.com/read/48659.htm

Does this sound like the proper process?


Thanks for any help you can provide.
 
C

Chak

Hi tlorek,

Here is the below sample source code written in asp page. Please save
this asp page on your IIS and access through URL, this asp page will be
deactivate the enterprise resource (Resource UID is 25 in my sample
page).

Please email me, if you have any further questions:

*****************************************************************************************************************

<%
Dim sURL, mydoc,cTimeout,startTime,elapsed
Set mydoc=Server.CreateObject("MSXML2.DOMDocument.3.0")



mydoc.Async = False

'replace projservername with correct name below

sURL = "http://projservername/projectserver/lgnPSAu.asp"

'replace below xxxx with correct password

sURL = sURL & "?un="& "Administrator" & "&pwd=" & "xxxxx"


mydoc.Load(sURL)



Do While mydoc.readyState < 4
elapsed = Timer() - startTime
If elapsed > cTimeout Then
Response.write("<br>something went wrong")
break
end if
Loop




Dim ssCookie, soNode

'Checking the errors while login to Project Server

If mydoc.parseError.errorCode = 0 Then
If Not mydoc Is Nothing Then
Set soNode = mydoc.selectSingleNode("Reply/Cookie")
If Not soNode Is Nothing Then
ssCookie = soNode.Text
else
Response.write("Cookie error1")
Response.Status = "403 Forbidden"
Response.End

End If
else
Response.write("Cookie error 2")
Response.Status = "403 Forbidden"
Response.End
End If
Else
Response.write("cookie error 3")
ssCookie = ""
Response.Status = "403 Forbidden"
Response.End
End If




Dim oSOAP , sXML,soapsURL,sRetVal,gXML, s1Dom,oWUIDNOdes,
ElemList, AssignmentElm


'The following will be deactivate resource (resource uid is 25 in
enterprise resource pool

fXML="<Request><ProjectsCheckout><Project><ProjectType>3</ProjectType></Project></ProjectsCheckout></Request>"

gXML="<Request><ResourceDeactivate><ResourceUID>25</ResourceUID></ResourceDeactivate></Request>"
hXML="<Request><ProjectsCheckin><Project><ProjectType>3</ProjectType></Project></ProjectsCheckin></Request>"



Set oSOAP = Server.CreateObject("PDS.CMain")

s1 = oSOAP.SoapXMLRequest(ssCookie,fXML)

s2 = oSOAP.SoapXMLRequest(ssCookie,gXML)

s3 = oSOAP.SoapXMLRequest(ssCookie,hXML)


If
instr(UCase(s2),UCase("<Reply><HRESULT>0</HRESULT><STATUS>0</STATUS><UserName>"
& "Administrator" & "</UserName></Reply>")) then
Response.write("Successful")

else
Response.write("<br><br>Resource ChakDeactivation Failed: " & s2)
Response.write("<br>ResPool CheckOut Status: " & s1)
Response.write("<br>ResPool CheckIn Status: " & s3)
end if



%>

*************************************************************************************************

Thanks
Chak
 
C

Chak

Hi tlorek,


Here is the below sample source code written in asp page. Please save

this asp page on your IIS and access through URL, this asp page will be

deactivate the enterprise resource (Resource UID is 25 in my sample
page).


Please email me, if you have any further questions:


***************************************************************************­**************************************

<%
Dim sURL, mydoc,cTimeout,startTime,elapsed
Set mydoc=Server.CreateObject("MSXML2.DOMDocument.3.0")


mydoc.Async = False


'replace projservername with correct name below


sURL = "http://projservername/projectserver/lgnPSAu.asp"


'replace below xxxx with correct password


sURL = sURL & "?un="& "Administrator" & "&pwd=" & "xxxxx"


mydoc.Load(sURL)


Do While mydoc.readyState < 4
elapsed = Timer() - startTime
If elapsed > cTimeout Then
Response.write("<br>something went wrong")
break
end if
Loop


Dim ssCookie, soNode


'Checking the errors while login to Project Server


If mydoc.parseError.errorCode = 0 Then
If Not mydoc Is Nothing Then
Set soNode =
mydoc.selectSingleNode("Reply/Cookie")
If Not soNode Is Nothing Then
ssCookie = soNode.Text
else
Response.write("Cookie error1")
Response.Status = "403 Forbidden"
Response.End


End If
else
Response.write("Cookie error 2")
Response.Status = "403 Forbidden"
Response.End
End If
Else
Response.write("cookie error 3")
ssCookie = ""
Response.Status = "403 Forbidden"
Response.End
End If


Dim oSOAP , sXML,soapsURL,sRetVal,gXML, s1Dom,oWUIDNOdes,
ElemList, AssignmentElm


'The following will be deactivate resource (resource uid is 25 in
enterprise resource pool )


fXML="<Request><ProjectsCheckout><Project><ProjectType>3</ProjectType></Pro­ject></ProjectsCheckout></Request>"


gXML="<Request><ResourceDeactivate><ResourceUID>25</ResourceUID></ResourceD­eactivate></Request>"


hXML="<Request><ProjectsCheckin><Project><ProjectType>3</ProjectType></Proj­ect></ProjectsCheckin></Request>"



Set oSOAP = Server.CreateObject("PDS.CMain")


s1 = oSOAP.SoapXMLRequest(ssCookie,fXML)


s2 = oSOAP.SoapXMLRequest(ssCookie,gXML)


s3 = oSOAP.SoapXMLRequest(ssCookie,hXML)


If
instr(UCase(s2),UCase("<Reply><HRESULT>0</HRESULT><STATUS>0</STATUS><UserNa­me>"
& "Administrator" & "</UserName></Reply>")) then
Response.write("Successful")
Else
Response.write("<br><br>Resource Deactivation
Failed: " & s2)
Response.write("<br>ResPool CheckOut Status: "
& s1)
Response.write("<br>ResPool CheckIn Status: " &
s3)
End if


%>


***************************************************************************­**********************



Thanks
Chak
 

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