I have tried many ways to connect to Citrix Presentation Server, but lately I have found the best way ever.
It is a new web service developed by Extentrix. you download it in your Citrix Presentation Server or on other web server connected to it.
by this you can develop your own application in any language or platform and query the applications from the server using the standard web service.
I advise every one who works on Citrix Presentation Server to download and try it free from :
it has solved me many problems. in the site you will find examples on how to consume the web service using java, c#.Net and others.
Keep Up with TechRepublic