You are on page 1of 20

Extentrix Web Services for Citrix Presentation Server White Paper

________________________________________________________________________

Table of Contents

EXECUTIVE SUMMARY .......................................................................................................................... 2


ACCESS TO CITRIX PRESENTATION SERVER................................................................................. 3
BARRIERS FACED ACCESSING CITRIX PRESENTATION SERVER............................................ 3
WHAT ARE WEB SERVICES................................................................................................................... 4
BENEFITS OF WEB SERVICES............................................................................................................... 5
WHAT IS EXTENTRIX WEB SERVICES FOR CITRIX PRESENTATION SERVER..................... 6
HOW EXTENTRIX WEB SERVICES ACCESSES CITRIX PRESENTATION SERVER................ 6
EXTENTRIX SUPPORTED FUNCTIONS............................................................................................... 8
EXTENTRIX WEB SERVICES FOR CITRIX PRESENTATION SERVER BENEFITS .................. 9
SIMPLIFY ACCESSING CITRIX PRESENTATION SERVER................................................................................ 9
PLATFORM INDEPENDENT........................................................................................................................... 9
STANDARD MEANS OF COMMUNICATION ................................................................................................... 9
TOOLS TO CREATE AND MANAGE WEB SERVICE ........................................................................................ 9
ABILITY TO CONNECT TO MANY FARMS .................................................................................................... 10
SUPPORTS SECURITY ................................................................................................................................ 10
DEVELOPER’S SUPPORT ...................................................................................................................... 11
HOW TO CALL EXTENTRIX WEB SERVICES FOR CITRIX PRESENTATION SERVER APIS ............................ 12
How to Call Extentrix Web Services for Citrix Presentation Server API using Java ......................... 12
How to Call Extentrix Web Services for Citrix Presentation Server API using ASP.Net.................... 13
How to Call Extentrix Web Services for Citrix Presentation Server API using JavaScript................ 13
HOW TO SECURE YOUR EXTENTRIX WEB SERVICES FOR CITRIX PRESENTATION SERVER........................ 16
IMPORTING CERTIFICATES ........................................................................................................................ 17
ABOUT EXTENTRIX ............................................................................................................................... 19

© Copyright 2007 Extentrix Systems. Page 1


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Executive Summary
Citrix Presentation Server offers application virtualization and application streaming for
optimal application performance. It enables the best access experience for any user, with
any device, working over any network. With the secure application architecture,
organizations can centralize applications and data in secure data centers, reducing costs
of management and support, increasing data security, and ensuring fast, reliable
performance.

Ensuring seamless exchange of information between company applications is the essence


for an IT strategy. Yet integrating applications with Citrix Application Delivery platform
is not that easy task because till now communicating with Citrix space is limited to Citrix
products.

There are several methods currently available from Citrix Systems to access a published
application for the Citrix Presentation Server product family:

o Program Neighborhood
o Program Neighborhood Agent
o Web Interface

Extentrix currently offers an additional set of products to access published applications:

o Extentrix Widget for Citrix Presentation Server


o Extentrix Gadget for Citrix Presentation Server

However, these two sets of utilities still don’t allow developers to launch published
applications from within their own applications or portals. Extentrix has resolved this
issue and unlocked the Citrix platform to the development community with Extentrix
Web Services for Citrix Presentation Server. This new product from Extentrix is built on
the open standard SOAP protocol allowing all web service consuming applications to
seamlessly access Citrix farms for published application access.

This white paper introduces the concept of Web services and identifies the benefits
associated with their implementation. Then it details the benefits of using Extentrix Web
Services for Citrix Presentation Server and how to integrate and use those WS APIs into
your application.

© Copyright 2007 Extentrix Systems. Page 2


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Access to Citrix Presentation Server


One way to connect to Citrix Presentation Server is to connect to a PNAgent site, which
in its turn communicates with Citrix XML Services running on IIS server as ISAPI from
within the private network which in its turn returns the information about published
applications and allows the published applications to be launched.

(XML Protocol)
Citrix XML PNAgent Site
Service
HTTP/S

HTTP/S XML

Outside World

Figure 1

Any information exchanged with the PNAgent site server assumes the form of XML data
delivered over an HTTP transport. The Citrix XML Service is nothing more than a simple
HTTP server publishing a single URL: /Scripts/wpnbr.dll. Citrix Secure Gateway
integration relies on a similar HTTP/XML service provided by the Secure Ticket
Authority, which publishes /Scripts/CtxSta.dll from an IIS server. PNAgent acts as a pass
through clients.

Barriers faced Accessing Citrix Presentation Server


Clear from the previous description and as shown in Figure1, the only language that can
communicate with Citrix Presentation Server is XML through NFuse XML Protocol.

So the key to access Citrix word is to learn its language, NFuse XML Protocol. The
problem is that there is no direct documentation about the protocol, how to request for
specific information or how to parse the response to get the data. NFuse XML Protocol
version can be found by inspecting the NFuse.dtd file, guarantying the results, building a
tool to create the XML request string and parse the returned XML document. And if you
work in a different platform and a different language then the tool should be repeated to
all languages used... how easy is that?!

And developers who would like to allow their applications or portal to access Citrix
farms or launch published applications from their Apps are left in the darkness.

© Copyright 2007 Extentrix Systems. Page 3


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

What are Web Services


Web services are software components that make itselves available over the internet be
accessed by other applications and use open standards-based Web technologies like
HTTP, XML, SOAP, WSDL and others for communication.

It has an interface described in a machine-processable format (specifically WSDL). Other


systems interact with the Web service in a manner prescribed by its description using
SOAP messages, typically conveyed using HTTP with an XML serialization in
conjunction with other Web-related standards.
Since they are based on open industry standards, Web services are hardware,
programming language, and operating system independent. This means that applications
written in different programming languages and running on different platforms can
seamlessly exchange data over intranets or the Internet using Web services.

More about these technologies is detailed below:

• XML (extensible Markup Language)

Extensible Markup Language (XML) is a simple, very flexible text format. It is classified
as an extensible language because it allows its users to define their own tags. Originally
designed to meet the challenges of large-scale electronic publishing, it is used to facilitate
the sharing of data across different information systems on the Web and elsewhere.

Because XML syntax consists of text-based mark-up that describes the data being tagged,
it is both application-independent and human readable. This simplicity and
interoperability have helped XML achieve widespread acceptance and adoption as the
standard for exchanging information between heterogeneous systems in a wide variety of
applications, including Web services.

• SOAP (Simple Object Access Protocol)

Simple Object Access Protocol (SOAP) is a lightweight protocol for exchanging XML-
based messages over HTTP/HTTPS. It consists of three parts: an envelope that defines a
framework for describing what is in a message and how to process it, a set of encoding
rules for expressing instances of application-defined data types, and a convention for
representing remote procedure calls and responses. Because HTTP is supported by all
Web servers and browsers, SOAP messages can be sent between applications regardless
of their platform or programming language.

• WSDL (Web Services Description Language)

WSDL is an XML format describing how to communicate using web services. The
WSDL defines services as collections of network endpoints, or ports operating on
messages containing either document-oriented or procedure-oriented information. In this
way, the WSDL definition acts as the initial Web service interface, providing clients with
all the information they need to interact with the service in a standards-based way. A

© Copyright 2007 Extentrix Systems. Page 4


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
client program connecting to a web service can read the WSDL to determine what
functions are available on the server. Any special data types used are embedded in the
WSDL file in the form of XML Schema.

Benefits of Web Services


There are so many benefits for Web Services. We are going to list some of them:

• The ease of integration with external data sources.


No longer does each application need to copy and maintain external data sources.
You can request and get information in real time, and transform it to your
particular format. This will allow you to deliver individualized software and
services, while your maintenance burden is reduced.

• Reduces complexity
All components in Web Services are encapsulated as services. The type of
behavior a service provides is more important than how it is implemented. A
WSDL document is the mechanism to describe the behavior of a service.

• Interoperable
Since Web Services are operating on the system boundaries (that is, outside of
private company networks), they are achieving a higher level of commonality
than has previously been available. For developers, this commonality means that
the applications and services they develop will enjoy a long life span, outlasting
their proprietary equivalents.

• Most Programming Languages support Web Services


Since Web Services are based on open standards, most of famous programming
languages like C#, C++ and Java are supporting the use of Web Services.

© Copyright 2007 Extentrix Systems. Page 5


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
What is Extentrix Web Services for Citrix Presentation Server
Extentrix Web Services for Citrix Presentation Server is a suite of web services APIs that
communicate with Citrix Presentation Server and provides you a complete access to
Citrix Application delivery platform.

Extentrix Web Services for Citrix Presentation Server represents a standard way to
communicate with Citrix Presentation Server world because it is built on open standards-
based Web technologies like HTTP, XML, SOAP and WSDL.

In addition, Extentrix Web Services for Citrix Presentation Server represents a platform
and language independent solution by design.

How Extentrix Web Services Accesses Citrix Presentation


Server
Extentrix Web Services for Citrix Presentation Server is the connecter between Citrix
Presentation Server world and the outside world. Extentrix Web Services connects to a
PNAgent site directly using NFuse protocol. The PNAgent site in its turn communicates
with Citrix Metaframe XML service and gets the data (list of published applications, or
ICA content to launch applications). Then the Web Service uses SOAP protocol to
deliver information about Citrix Presentation Server’s published applications. The
Developer can discover the web service’s APIs via the WSDL (web service description
language) and then generate the appropriate proxy that will get the response as SOAP
messages which are platform independent.

© Copyright 2007 Extentrix Systems. Page 6


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Figure 2
This diagram shows how the Extentrix Web Services talks to Citrix Presentation Server. For better security,
we recommend to have the Extentrix Web Services resides in the DMZ.

© Copyright 2007 Extentrix Systems. Page 7


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Extentrix Supported Functions


Extentrix Web Services for Citrix Presentation Server comes with suite of APIs functions
that request information and services from Citrix Presentation Server. These functions
include:

ƒ GetApplicationInfo
Gets information about a published application for a specific client with the
specified details, server types, and client types.

ƒ GetApplicationsByCredentials
Gets all published applications for a specific client with the specified details,
server types, and client types.

ƒ GetCodebaseURL
Returns the URL CodeBase of the PNAgent server that specifies the location
where the java classes used to launch the application via java client reside.

ƒ LaunchApplication
Returns the ICA file description to be used to launch an application.

ƒ LaunchApplicationWithParameter
Returns the ICA file description to be used to launch an application with a
given parameter.

ƒ ValidateCredentials
Checks the user's credentials and returns true if they are valid and returns false
if they are not.

© Copyright 2007 Extentrix Systems. Page 8


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Extentrix Web Services for Citrix Presentation Server benefits


Simplify accessing Citrix Presentation Server
Simplifying access to CPS is major benefit of Extentrix web services for Citrix
Presentation Server. The web services makes connecting to CPS is as simple as creating
proxy to a web service. Extentrix provides a familiar and standard way of communication
to communicate with Citrix Presentation Server. The connection process requires creating
a web service hosted on IIS which is very easy using Extentrix management console-
explained later-, then any one using any programming language can invoke the web
services.
Note: The web service doesn’t need to be in the same server of Presentation Server. We
recommend having IIS server hosting the web services resides in the DMZ.

XML XML / SOAP


Citrix Extentrix Web
Presentation Services for Outside World
Server HTTP/S CPS HTTP/S

Figure 3

Now, it is very simple to access Citrix Application Delivery Platform, thanks to Extentrix
Web Services for Citrix Presentation Server APIs.

Platform Independent
Extentrix Web Services for Citrix Presentation Server provides a standard means of
communication with Citrix Presentation Server among different software applications,
running on a variety of platforms and/or frameworks because it uses the standard SOAP,
XML, WSDL protocols in communication messages. And those protocols are platform
independent. So, it services any application talks SOAP, XML and WSDL. Extentrix
Web Services for Citrix Presentation Server gives a simplified mechanism to connect
applications regardless of the technology or devices they use, or their location.

Standard Means of Communication


Extentrix Web Services for Citrix Presentation Server is based on industry standard
protocols with universal support. All the communities understand this protocol, so it is
easy for developers to utilize and use Extentrix Web Services.

Tools to create and manage WEB Service


With its Web Services for Citrix Presentation Server package, Extentrix provides a very
simple to use, with powerful tools, nice UI and rich functionality management console.
© Copyright 2007 Extentrix Systems. Page 9
Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
With this management console, the user can create new web service, edit an existing one
or browse it, with IIS like view, to give users the feeling that they are familiar with.

Ability to connect to many farms


Using Extentrix management consol, users can create many web services and each web
service connects to a farm, so the user can connect to many farms.

Supports Security
Extentrix Web Services for Citrix Presentation Server helps you in securing your web
services. Today, HTTPS and BASIC authentication are often used to secure Web service
communications. While this simple transport-level security is sufficient for simple, point-
to-point Web services, their use is vulnerable to security breaches in multi-hop networked
interactions. Further, there are underlying performance issues inherent in HTTPS.
HTTPS supports only a one user credential per connection, so a highly-scaled server-to-
server communication might require hundreds or thousands of connections, a huge
scalability challenge. By contrast, Web Service Security works by specifying security
policy at the SOAP message level. Extentrix Web Services for Citrix Presentation Server
enables you to attach a policy file to your web services at creation time. Policy supports
automation with tools and infrastructure. Because these communications contracts can
and do change over time (in response to new regulatory requirements, for example), these
benefits are not one-time events, so use of Policy reduces on-going workload as well. In
sum, Policy enhances the flexibility of SOAP implemented using Web services, and it
does so in an open and interoperable way. But in this release, security is limited to X.509
certificate, which may be used to validate a public key that may be used to authenticate a
message or to identify the public key with which a message has been encrypted.

Where to use Extentrix Web Services


Below is a list of some most common application of the Extentrix Web Services APIs is
to:
• Portal sites; provide connection to Citrix published application.
• Custom developed applications that give the user the ability to launch application
not installed in their machines but published on Citrix Presentation Server.
• Straight forward integration with major platforms like SAP platform.

© Copyright 2007 Extentrix Systems. Page 10


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Developer’s support
Extentrix provides developers with a very easy to read manual that describes the APIs,
where to use them and how.

Extentrix provides on its web site a Test Drive page


(http://www.extentrix.com/web%20services/Test%20Drive.htm) that contains examples
to allow developers to test drive Extentrix Web Services for Citrix Presentation Server
live. The examples use a reference to a test web service which is connected to Citrix
TestDrive PNAgent Site. They will enable developers to test how certain applications can
be launched through a web service that was created by Extentrix Web Services for Citrix
Presentation Server.

In addition, there are many examples with their source code published on Developers
page (http://www.extentrix.com/web%20services/Developers.htm). Those useful
samples source code written in different languages and help developers learning how to
integrate their application with Extentrix Web Services for Citrix Presentation Server.

© Copyright 2007 Extentrix Systems. Page 11


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

How to Call Extentrix Web Services for Citrix Presentation Server APIs
In this section, we will show you how to call Extentrix web services for Citrix
Presentation Server APIs in Java and C#. We assume that the developer will create a
web reference (web service proxy). The complete code for those samples can be found on
Extentrix web site (http://www.extentrix.com/web%20services/Developers.htm)

We will use our published web service URL for test purposes:
http://www.extentrix.com/webservices/1.0.0/ExtentrixServiceCitrixPS.asmx

How to Call Extentrix Web Services for Citrix Presentation Server API using
Java

This code is written using Oracle Java Developer IDE after creating Web Service Proxy.

1. Add the following import statements to invoke the web services:

import com.extentrix.proxy.ExtentrixServiceCitrixPSSoap12Client;
import com.extentrix.proxy.Credentials;

2. Create an object from the created web services proxy.

ExtentrixServiceCitrixPSSoap12Client proxy =
new ExtentrixServiceCitrixPSSoap12Client();

3. Create Credential object, and set its members.

Credentials crend = new Credentials();


crend.setDomain("testdrive";);
crend.setUserName("citrixdesktop");
crend.setPassword("demo");
crend.setDomainType(0);
crend.setPasswordEncryptionMethod(0);

4. Invoke the web service.

String icaFile= proxy.launchApplicationWithParameter("",


fileName,
crend, clientName, clientIp);

© Copyright 2007 Extentrix Systems. Page 12


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

How to Call Extentrix Web Services for Citrix Presentation Server API
using ASP.Net

This code is written using Microsoft Visual Studio 2005, after creating a Web Reference.

1. Add the following Using statements to invoke the web services:


Using ourwebservice;
Ourwebservice : the name of the web reference.

2. Create an object from the created web service reference.


ExtentrixServiceCitrixPS proxy = new ExtentrixServiceCitrixPS();

3. Create Credential object, and set its members.


Credentials credentials = new Credentials();
credentials.Password = "demo";
credentials.UserName = "citrixdesktop";
credentials.Domain = "testdrive";
credentials.PasswordEncryptionMethod = 0;
credentials.DomainType = 0;

4. Invoke the web service.


string icaContent =
proxy.LaunchApplicationWithParameter(application, filename,
credentials, clientname, clientIP);

For more Information about Extentrix web services APIs, please refer to Developers’
Manual.

How to Call Extentrix Web Services for Citrix Presentation Server API
using JavaScript

1. You need to enable connecting with the web service from any control using this
property.

style="behavior:url(webservice.htc);"

© Copyright 2007 Extentrix Systems. Page 13


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
2. Create connection to Extentrix web services and name it as Service1.

service.useService("http://www.extentrix.com/webservices/1.0.0/Ex
tentrixWebServicesForCPS.asmx?WSDL","Service1");

// where service is the enabling control in the previous step

3. Create Credential class.

function Credentials(UserName,Password,Domain,Type,Method)
{
this.UserName=UserName;
this.Password=Password;
this.Domain=Domain;
this.DomainType=Type;
this.PasswordEncryptionMethod=Method;
}

4. Create Credential object, and set its members.

myusername = "citrixdesktop";
mypassword = "demo";
mydomain = "testdrive";
mytype = 0;
mymethod = 0;

var credentials = new


Credentials(myusername,mypassword,mydomain,mytype,mymethod);

5. Invoke launchApplicationWithParameter API.

var iCallID =
service.Service1.callService("LaunchApplicationWithParameter",
application, filename,credentials, clientname, clientIP);

6. Receiving API results using this property in the enabling control.

© Copyright 2007 Extentrix Systems. Page 14


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

onresult="onmyresult()";

onmyresult function recieves the ica file content.

icaContent = event.result.value;

save it to a file on the client’s machine

array = icaContent.split('\n');
var Fs = new ActiveXObject("Scripting.FileSystemObject");
var Output = Fs.OpenTextFile(fileName,2,true);
var content = array[0] + "\n";
for (i = 1; i < array.length; i++)
{
content += array[i] + "\n";

Output.write(content);
Output.close();

and run it using ICA client.

url = "file:///" +fileName;


WSH=new ActiveXObject("WScript.Shell");
WSH.run(url);

© Copyright 2007 Extentrix Systems. Page 15


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

How to Secure your Extentrix Web Services for Citrix Presentation Server

This release of Extentrix Web Services for Citrix Presentation Server supports security
based on Microsoft WSE 3.0, and it is a prerequisite if you want to secure your Extentrix
Web Services for Citrix Presentation Server using our Admin tool wizard.

Simple steps to secure your Extentrix Web Services for Citrix Presentation Server:

1. Create your Policy file using Microsoft WSE 3.0 tools.


2. From start Menu open Extentrix Web Services Management console.

Figure 4

3. Create new web service, and walk on the wizard till you reach the Security
Settings page.
a. Select Advanced Security
b. Click Choose Policy file button to browse and select your policy file
created in step 1.
c. Fill the Policy Name field with the name of your policy created in step 1.

© Copyright 2007 Extentrix Systems. Page 16


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________

Figure 5

Importing certificates

If a Microsoft WSE 3.0 exception occurs (check your Event Viewer), please check your
certificate. You may need to import your certificate and give permission for your
ASP.NET client. You will need to import the certificate to the local machine store instead
of personal store.

To do this:

1. Run mmc (from Start->Run), and choose Add Snap-in (Ctrl+M).


2. Select Add to add “Certificates” to the certificate manager.
3. When prompted for location, select Computer Account, and then Local
Computer (the default is user account). We assume that the certificate is
imported to one of the root certificate authorities (e.g. Third-Party Root
Certificate Authorities).

© Copyright 2007 Extentrix Systems. Page 17


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
ASP.Net typically runs under IIS_WPG under Windows 2003 server by default. For
Windows 2003 server, you will need to grant the rights to the IIS_WPG user so that
ASP.Net can access the certificate. This can be achieved by using:

a- Microsoft’s winhttpcertcfg.exe utility as shown below:

winhttpcertcfg.exe -g -c LOCAL_MACHINE\Root -s "{certificate name}" -a


"IIS_WPG".

b- Microsoft WSE 3.0 Certificates Tools

Note: The ASP.Net worker process might be running under an account other than the
ones mentioned above (i.e. customized to run under a particular user account), and in this
case, you will need to grant permission to whatever process the work process is running
under.

© Copyright 2007 Extentrix Systems. Page 18


Extentrix Web Services for Citrix Presentation Server White Paper
________________________________________________________________________
About Extentrix
Founded in 2006, Extentrix Systems is a leading software development company
specializing in virtualization and developing custom software solutions for Microsoft and
Citrix customers. Established by former software engineers at Citrix, Extentrix have
developed access solutions that simplify and speed users’ access to Terminal Services
and Citrix platforms.

Extentrix Systems is privately held with company headquarters in RAK, UAE. For more
information, please visit the company’s Web site at www.extentrix.com or call +971-4-
211-5490.

Extentrix Systems
P.O.Box 43659
Dubai, UAE
Tel: +971 4 211 5490
Fax: +971 4 211 5101
info@extentrix.com

To learn more please refer to the following resources:

Learn More
Extentrix Web Services for Citrix Presentation Server Home Page

Free Download
Try Extentrix Web Services for Citrix Presentation Server free for thirty days.

Test Drive
Test drives Extentrix Web Services for Citrix Presentation Server right away.

Developers
Visit Extentrix Web Services for Citrix Presentation Server developers’ section.

© Copyright 2007 Extentrix Systems. Page 19

You might also like