Chris Fleck previously, had talked about Extentrix's Web Services 2.0 - Application Edition which is developed by Citrix Ready partner Extentrix. This is a very useful tool that allows developers to directly integrate Citrix published applications, contents and desktop into corporate portals, company web sites and applications while reducing time and effort in development. Well, Extentrix has just released Web Services 4.0 with some impressive new features.
What is really interesting is that Extentrix provides lots of sample code on how to publish Citrix applications with Java, ASP.Net, and SharePoint. For example, looking at Extentrix’s “Integration with Microsoft SharePoint 2007” technote, it is impressive how simple it is to add a Citrix application within a SharePoint portal. From the technote:
1. Start by creating a C# class library (.dll) project using VS.Net 2005.
2. Open the “Add Reference” dialog window. You will create a reference from within the “.Net” components tab to System.Web into the project. The System.Web dll will contain the namespace object System.Web.UI.WebControls.WebParts.
3. Rename the Class1.cs file to project_name.cs where poject_name is the same as the C# DLL project you started.
4. From the Extentrix code example below we see the following:
- Creating an inheritance for your new project class using System.Web.UI.WebControls.WebParts.WebPart.
- Implement both the protected override void RenderControl (HtmlTextWriter writer) method and the protected override void CreateChildControls() method.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace SmartAccess
{
public class SmartAccess : WebPart
{
Button testButt = new Button();
protected override void CreateChildControls()
{
Controls.Add(testButt);
}
public override void RenderControl(HtmlTextWriter writer)
{
RenderChildren(writer);
}
}
}
5. Add a web reference using Extentrix Web Services 4.0.
a. Right click your project node and select Add Web Reference.
b. When the “Add Web Reference” window appears, add the URL of Extentrix Web Services 4.0 – Application Edition into URL field and click GO.

Click Add Reference.
6. Add the using statement to invoke the web services:
using ExtentrixSmatrtAccess. Ourwebservice;
Ourwebservice: the name of the web reference.
- Create an object from the created web service reference.
ExtentrixWebServicesForCPS service = new ExtentrixWebServicesForCPS();
8. Create a Credential object, and set its members. In this example, the members are queried from the user.
Credentials cred = new Credentials();
cred.UserName = "citrixdesktop";
cred.Password = "demo";
cred.Domain = "testdrive";
cred.DomainType = 0;
cred.PasswordEncryptionMethod = 0;
9. Invoke the web service.
ApplicationItem[] Apps = service.GetApplicationsByCredentials(cred, "w2kserver", "172.19.7.100", new string[] { "defaults", "icon" }, new string[] { "all" }, new string[] { "all" });
Build the project and you are ready to deploy the Web Part to the Portal Site. The project DLL file will be copied into a SharePoint GAC folder. You will need to register the DLL in the web.config file using something like
‘<SafeControl Assembly="ExtentrixSmartAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=74e5f216d6256126" Namespace=" ExtentrixSmartAccess" TypeName="*" Safe="True" />)
Once the DLL is registered, SharePoint should see the web parts for the DLL. You can then add the web part into the portal. The final result would look like this:

There are many more code samples to play with in this release. If you are new to integrating Citrix XenApp and web portals, you should definitely take a look and tell us what you think. Extentrix will even give you a free trial.