Steps :-
1. Add Web reference http://localhost/niku/wsdl/Object/Projects and name it as PRJ
2. Create a New "ASP.NET Web application Project". Create a Multiline Textbox in it say Textbox1 ( To display XOG output )
3. On the PageLoad event add following :-
Dim PS As New PRJ.ProjectsService
Dim Log As New PRJ.Login
Dim Auth As New PRJ.Auth
Dim SoapXML As New System.Xml.XmlDocument
Dim DataBus As System.Xml.XmlElement
Dim XOGOutput As System.Xml.XmlElement
Dim sessionId As String
Log.Password = "admin"
Log.Username = "admin"
sessionId = PS.Login(Log)
Auth.SessionID = sessionId
PS.AuthValue = Auth
SoapXML.Load("c:\xog\Read_project.xml")
XOGOutput = PS.ReadProject(SoapXML.DocumentElement)
TextBox1.Text = XOGOutput.InnerXml
PS.Logout(sessionId)
4. Read_Project.xml looks like as below :-
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<NikuDataBus xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
<Header version="6.0.11" action="read" objectType="project" externalSource="NIKU">
<!-- you change the order by simply swap 1 and 2 number in the name attribute -->
<args name="order_by_1" value="name"/>
<args name="order_by_2" value="projectID"/>
<args name="include_tasks" value="false"/>
<args name="include_resources" value="false"/>
<args name="include_custom" value="false"/>
<args name="include_dependencies" value="false"/>
</Header>
<Query>
<Filter name="projectID" criteria="EQUALS">Clarity_test</Filter>
</Query>
</NikuDataBus>
* This was tested on Clarity 7.5.3.
Sangeet,
ReplyDeleteWhen I test your code in Visual Studio 2008, program moves past the Login code, but the session is still set to NOTHING.
Is there a way to more explicitly check to see if the web service is responding correclty?
I would recommend to first test Web Service by soap clients like SoapSONAR, SoapUI etc... Then test code in Visual Studio..
ReplyDeleteLet me know if it still doesn't work.
Thanks
Sangeet
I tried the example and got the same result, but after some troubleshooting, I found the solution and an additional issue:
ReplyDelete1. If you are receiving a null/nothing from the ReadProject method, you might need to have the correct rights assigned to you by Clarity (ie XOG Admin). Once the rights are assigned, you will get a response from the server.
2. Within the Read_Project XML block posted above (step 4), there is an extra space in the www.w3.org URL, right after the http:// protocol indicator. The line, in part, reads, "http:// www.w3.org..." It should read, "http://www.w3.org..." As is, the block generates an error stream. Corrected, it will return the information requested.
Thanks very much for an otherwise well written example!
Regards,
Robert ...
works in vs 2005 not in vs 2008
ReplyDeleteSangeet,
ReplyDeleteI'm getting a connection time out error. It this error something to be dealt with at Clarity Server or my application. Also, this XML file needs to be on Clarity server somewhere? Can you please give more details.
Thanks,