{"id":4264,"date":"2012-08-16T11:47:18","date_gmt":"2012-08-16T09:47:18","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=4264"},"modified":"2013-06-15T13:47:03","modified_gmt":"2013-06-15T11:47:03","slug":"the-citrix-xml-server-explained-and-demystified","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/the-citrix-xml-server-explained-and-demystified\/","title":{"rendered":"The Citrix XML server explained and demystified"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"\" border=\"0\" alt=\"\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Matrix-Citrix-XML-server1.png\" width=\"119\" height=\"82\" \/>The Citrix XML server is a component of Citrix XenApp and XenDesktop that\u2019s used to enumerates available resources&#160; and provide secure tickets for users that&#160; to use the&#160; WebInterface or CloudGateway.<\/p>\n<p>&#160;<\/p>\n<p>In this article I\u2019ll explain what the services the XML service provide, how it does it job and all you need to know about it.<\/p>\n<p><!--more--><\/p>\n<h2><font style=\"font-weight: bold\">Introduction<\/font><\/h2>\n<p>The Citrix XML service is a <strong>Windows service <\/strong>that is part of the Citrix XenApp and XenDesktop product. It is used to provide <strong>XML <\/strong>data requests sent by Citrix components. It is introduced with MetaFrame 1.8 SP2, since MetaFrame XP is is a standard feature.&#160; Up to <strong>XenApp 6.0<\/strong> each XenApp server could be a XML broker. Since <strong>XenApp 6.5<\/strong>, where the controller-worker architecture is introduced, only a server with the <strong>controller<\/strong> role can be a XML broker. A server with the controller role is responsible for farm management. <\/p>\n<p>The Citrix XML service is most commonly used to provide users access to their applications and desktops via a <strong>web portal<\/strong>, leveraging the services of WebInterface, CloudGateway (Storefront) or Access Gateway. It is also used when users connect via the <strong>TCP\/IP+HTTP<\/strong> protocol.<\/p>\n<p>It is recommended to have multiple servers with the Citrix XML server, as close as possible to the servers <strong>Zone Data Collectors <\/strong>(XenApp) and <strong>Desktop Delivery Controller <\/strong>(XenDesktop).<\/p>\n<p>&#160;<\/p>\n<p><font style=\"font-weight: bold\"><\/font><\/p>\n<h2><font style=\"font-weight: bold\">Windows Service<\/font><\/h2>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-XML-Service-Properties.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Citrix XML Service Properties\" border=\"0\" alt=\"Citrix XML Service Properties\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-XML-Service-Properties_thumb.png\" width=\"154\" height=\"173\" \/><\/a>The windows service is identified by the name <em><strong>CtxHttp<\/strong>,<\/em> which reveals it leverages this <strong>protocol<\/strong> for network <strong>transportation<\/strong>. Basically the Citrix XML service has a built-in (simplified) webserver to <strong>transfer <\/strong>XML documents. <\/p>\n<p>The service is launched with the predefined local <em><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms684272(v=vs.85).aspx\" target=\"_blank\">Network Service<\/a><\/em>&#160;<strong>account<\/strong>, which allows it to communicate over the network.<\/p>\n<p>XML? XML stands for Extensible Markup Language, it is a markup language for documents containing structured information (<a href=\"https:\/\/en.wikipedia.org\/wiki\/XML\" target=\"_blank\">wikipedia<\/a>).<\/p>\n<p>&#160;<\/p>\n<h2><font style=\"font-weight: bold\">Files<\/font><\/h2>\n<p>The Citrix XML service consists of a number of files to provide its services. The files are , by default, stored in <em>%ProgramFiles%\\Citrix\\System32<\/em> on a 32-bit operating system and <em>%ProgramFiles(x86)%\\Citrix\\System32<\/em> on a 64-bit operating system.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"1\" width=\"589\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"98\"><strong>File<\/strong><\/td>\n<td valign=\"top\" width=\"489\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxadmin.dll<\/td>\n<td valign=\"top\" width=\"489\">Citrix Web Program Neighborhood<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxconfproxy.dll<\/td>\n<td valign=\"top\" width=\"489\">Citrix ConfProxy ISAPI (a Web Service Extension)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxsta.config<\/td>\n<td valign=\"top\" width=\"489\">Configuration data for the Secure Ticket Authority (STA)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxsta.dll<\/td>\n<td valign=\"top\" width=\"489\">The Secure Ticket Authority (STA)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxxmlss.txt<\/td>\n<td valign=\"top\" width=\"489\">Encoding information for the windows service (CodePage translation entries)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">ctxxmlss.exe<\/td>\n<td valign=\"top\" width=\"489\">The windows service (also used to configure and bind the Citrix XML service)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"98\">WPnBr.dll<\/td>\n<td valign=\"top\" width=\"489\">Citrix XML ISAPI (a Web Service Extension), a connector for Web Interface<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#160;<\/p>\n<h2><font style=\"font-weight: bold\">Communication<\/font><\/h2>\n<p>By default the Citrix XML service listens on TCP port: 80. Although this is the default port, Citrix recommends using port <strong>8080. <\/strong><\/p>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\">IIS integration<\/font><\/h5>\n<p>If Microsoft Internet Information Services (IIS) is installed the Citrix XML Service is <strong>integrated <\/strong>by default. Otherwise the Citrix XML service defaults to <strong>standalone <\/strong>mode. If during the installation the an IIS server (or the IIS server role) is detected, the<strong> <\/strong>files <strong>specified<\/strong> above folder are copied from <em>%ProgramFiles(x86)%\\Citrix\\system32\\<\/em> to <em>%SystemRoot%\\inetpub\\scripts<\/em>. Letting the Citrix XML server integrate with IIS effectively (sharing ports) <strong>disables<\/strong> the use of the Windows Service and creates a <strong>Web Service <\/strong>in IIS. <\/p>\n<p>You can test the IIS integration by opening the the following url in your browser <a href=\"https:\/\/hostname\/Scripts\/ctxsta.dll\"><em>https:\/\/hostname\/Scripts\/ctxsta.dll<\/em><\/a>. If the integration is configured correctly you should get the following response:<\/p>\n<pre>HTTP Error 405.0 \u2013 method not supported\r\nThe page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.\r\n \r\nModule IsapiModule\r\nNotification ExecuteRequestHandler\r\nHandler ISAPI-dll\r\nError Code 0\u00d700000000<\/pre>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<p><font style=\"font-weight: bold\"><\/font><\/p>\n<p><font style=\"font-weight: bold\"><\/font><\/p>\n<p><font style=\"font-weight: bold\"><\/font><font style=\"font-weight: bold\"><\/font><\/p>\n<p><font style=\"font-weight: bold\"><\/font><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 10px 0px 0px; display: inline; float: left\" title=\"\" alt=\"\" align=\"left\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/windows-update-shield.png\" width=\"40\" height=\"50\" \/>It is <strong>not <\/strong>recommend to integrate the Citrix XML Server in IIS and use the share port 80 with IIS (<a href=\"https:\/\/support.citrix.com\/proddocs\/topic\/xenapp6-w2k8-admin\/ps-sf-citrix-xml-service-port-set-v2.html\" target=\"_blank\">Configuring the Citrix XML Service Port and Trust &#8211; Citrix eDocs<\/a> &#8211; <a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2009\/10\/21\/beware-of-hosting-web-interface-on-xenapp-servers\" target=\"_blank\">Beware of Hosting Web Interface on XenApp Servers &#8211; Nicholas Dille<\/a>)<\/p>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\">Changing the Citrix XML Service port number<\/font><\/h5>\n<p>If a different process requires the same ports you will receive the message \u201cCitrix XML port selected is in use by another application or service\u201d. If necessary you can change the port of the Citrix XML server. <em>The Citrix XML Service and Microsoft IIS can share a port (default = 80), you should only specify a different port if you don\u2019t want to share ports.<\/em><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/netstat-ano-p-tcp.gif\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"netstat -ano -p tcp\" border=\"0\" alt=\"netstat -ano -p tcp\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/netstat-ano-p-tcp_thumb.gif\" width=\"154\" height=\"57\" \/><\/a>To find out what other process is using the same port you can run the following command: <font face=\"Courier New\">netstat \u2013ano \u2013p tcp <\/font><font face=\"Arial\">(or <font face=\"Courier New\">netstat \u2013ban \u2013tcp<\/font> if you have Windows 7 \/ 2008) and locate the process ID (PID) that listens on the same port.<\/font><\/p>\n<p>In XenApp 6.0 or later changing the XML port can be done with a server policy: <em>XML Service\\XML service port<\/em>. However, this can only be done if you selected a <strong>custom <\/strong>port during installation instead of <strong>Share with IIS<\/strong>.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Citrix policy - XML Service\" border=\"0\" alt=\"Citrix policy - XML Service\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service_thumb.png\" width=\"154\" height=\"116\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-XML-service-port.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Citrix policy - XML Service - XML service port\" border=\"0\" alt=\"Citrix policy - XML Service - XML service port\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-XML-service-port_thumb.png\" width=\"154\" height=\"116\" \/><\/a><\/p>\n<p>The port number can also be changed with the <a href=\"https:\/\/support.citrix.com\/proddocs\/topic\/xenapp5fp-w2k8\/ps-commands-ctxxmlss-v2.html\" target=\"_blank\"><em>ctxxmlss<\/em><\/a> command-line utility.&#160; This can be done by unloading the Citrix XML Service with <strong>\/u<\/strong>, changing the port with <strong>\/r&lt;port number&gt;<\/strong> and restarting the XML service.<\/p>\n<pre>ctxxmlss \/u\r\nctxxmlss \/r8080<\/pre>\n<p>An alternative method is by changing the port in the <strong>registry <\/strong>(and restart the Citrix XML service after changing).<\/p>\n<pre><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/HKLM-SYSTEM-CurrentControlSet-Services-CtxHttp.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"HKLM\\SYSTEM\\CurrentControlSet\\Services\\CtxHttp\" border=\"0\" alt=\"HKLM\\SYSTEM\\CurrentControlSet\\Services\\CtxHttp\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/HKLM-SYSTEM-CurrentControlSet-Services-CtxHttp_thumb.png\" width=\"154\" height=\"64\" \/><\/a>Key: HKLM\\SYSTEM\\CurrentControlSet\\Services\\CtxHttp\r\nValue: TcpPort\r\nType: DWORD (32-bit)<\/pre>\n<p>The value is listed in hex, you need to change the view to decimal.<\/p>\n<p>&#160;<\/p>\n<h2><font style=\"font-weight: bold\">Citrix XML Service Trust<\/font><\/h2>\n<p>The security level of the Citrix XML service can be lowered by allowing the Citrix XML Service to <strong>trust all requests<\/strong>. The trust setting is only for <strong>Smooth Roaming <\/strong>when users authenticate using pass-through or smart-card authentication with WebInterface or online plug-in.<\/p>\n<p>To avoid security risks, only <strong>enable<\/strong> the Citrix XML service to trust requests it receives when you\u2019re <strong>confident<\/strong> that only <strong>trusted<\/strong> services communicate with the Citrix XML Service. This can be achieved by using firewalls or using IPSec. By default the trust is <strong>disabled<\/strong>.<\/p>\n<p>In XenApp 5.0and Presentation Server 4.x enabling the XML trust can be done via the Citrix Access Management Console (AMC) in the the <strong>server settings<\/strong>: <em>XML Service<\/em><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Server-Properties-XML-Service.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Server Properties - XML Service\" border=\"0\" alt=\"Server Properties - XML Service\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Server-Properties-XML-Service_thumb.png\" width=\"154\" height=\"120\" \/><\/a><\/p>\n<p>In XenApp 6.0 or later enabling the XML trust can be done with a server policy: <em>XML Service\\Trust XML requests<\/em>. <\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Citrix policy - XML Service\" border=\"0\" alt=\"Citrix policy - XML Service\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-2_thumb.png\" width=\"154\" height=\"116\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-Trust-XML-requests.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Citrix policy - XML Service - Trust XML requests\" border=\"0\" alt=\"Citrix policy - XML Service - Trust XML requests\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Citrix-policy-XML-Service-Trust-XML-requests_thumb.png\" width=\"154\" height=\"116\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<h2><font style=\"font-weight: bold\">Services provided <\/font><\/h2>\n<p>When a <strong>user <\/strong>starts his <strong>browser <\/strong>and connects to the URL of the web portal (WebInterface or Citrix Access Gateway), authenticates and launches an application (or desktop) a number of <strong>transactions <\/strong>take place between the WI\/CAG and the XML Service. <\/p>\n<p>In a basic environment where the users connects to a published resource via a Citrix Access Gateway, the following transactions takes places.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Example-communication-flow1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Example communication flow\" border=\"0\" alt=\"Example communication flow\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Example-communication-flow_thumb1.png\" width=\"604\" height=\"348\" \/><\/a><\/p>\n<ol>\n<li>The provides his <strong>credentials<\/strong> to the webserver (WI or CAG) <\/li>\n<li>The webserver reads the credentials and <strong>authenticates<\/strong> the user (based on the settings of the web site) <\/li>\n<li>The webserver sends the credentials to one (or more) <strong>Citrix XML servers <\/strong>for each<strong> farm <\/strong>to validate the credentials (<font face=\"Courier New\">RequestValidateCredentials<\/font>) and to get a list of available resources (<font face=\"Courier New\">RequestAppData<\/font>) <\/li>\n<li>The Secure Ticket Authorithy (STA), part of the Citrix XML server, returns a <strong>secure ticket <\/strong><\/li>\n<li>The XML broker, part of the Citrix XML server, <strong>queries <\/strong>the IMA service (XenApp) or Desktop Delivery Controller (XenDesktop) for <strong>resources available <\/strong>for the user <\/li>\n<li>The XML service <strong>returns <\/strong>an <strong>XML file <\/strong>containing the secure ticket (<font face=\"Courier New\">ResponseValidateCredentials<\/font>) and available resources (<font face=\"Courier New\">ResponseAppData<\/font>) <\/li>\n<li>The web server <strong>generates <\/strong>a web page containing all the resources the user can access (or the shortcuts are placed on the desktop \/ start menu by the PN agent) <\/li>\n<li>The user clicks on a resource <\/li>\n<li>The webserver <strong>requests <\/strong>the XML server (from the farm \/ site where the resource belongs to) for the <strong>system <\/strong>to connect to (<font face=\"Courier New\">RequestAddress<\/font>) <\/li>\n<li>The STA server <strong>queries <\/strong>the IMA service (XenApp) or Desktop Delivery Controller (XenDesktop) for the system that can <strong>provide <\/strong>the resource <\/li>\n<li>The STA returns the system that can provide the resource to the CAG (<font face=\"Courier New\">ResponseAddress<\/font>) <\/li>\n<li>The webserver sends a <strong><em>default.ica<\/em> file<\/strong> containing <strong>information<\/strong> about the resource, STA server (as configured in the secure access settings in the WebInterface) secure ticket and connection properties (more information about the ICA file can be found <a href=\"https:\/\/ingmarverheij.com\/en\/2012\/07\/the-citrix-ica-file-explained-and-demystified\/\" target=\"_blank\">here<\/a>). <\/li>\n<li>The Citrix client (for instance the Receiver) makes a <strong>connection<\/strong> to the <strong>CAG<\/strong> <\/li>\n<li>The CAG <strong>requests<\/strong> the STA server (stored in the ICA file) if the secure ticket is <strong>valid <\/strong>and to which system to connect <\/li>\n<li>The STA server <strong>validates<\/strong> the secure ticket (from <strong>memory<\/strong>) <\/li>\n<li>The CAG server <strong>accepts<\/strong> the connection and the <strong>connection<\/strong> is started. <\/li>\n<\/ol>\n<p><em>Nicholas Dille wrote an excellent article called \u2018<\/em><a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2008\/07\/17\/talking-to-the-xml-service-update\/\" target=\"_blank\"><em>Talking to the XML Service<\/em><\/a><em>\u2019. If you want to dive deeper in the messages being sent by the Citrix XML Service, you should read it.<\/em><\/p>\n<p>&#160;<\/p>\n<p>So, basically the XML service has two functions:<\/p>\n<ul>\n<li>Communicating with the XenApp farm \/ XenDesktop zones; the XML broker <\/li>\n<li>Generating and validating secure ticket to authorize users, the Secure Ticket Authority (STA) <\/li>\n<\/ul>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<h4><font style=\"font-weight: bold\">1. The XML broker<\/font><\/h4>\n<h5><font style=\"font-weight: bold\">Introduction<\/font><\/h5>\n<p>The Web Interface and the XML Broker are <strong>complementary <\/strong>services. The Web Interface provides users with access to applications. The XML Broker determines which resources (like applications, desktops, etc.) appear in the Web Interface, based on the user\u2019s permissions.<\/p>\n<p>The XML broker is used by the Web Interface to <strong>enumerate <\/strong>published resources from the a XenApp farm or XenDesktop site. This server also communicates directly with a Zone Data Collector (XenApp) or Desktop Delivery Controller (XenDesktop) to determine the system to route a user to when an application is launched through the Web Interface.<\/p>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<h5><font style=\"font-weight: bold\">Troubleshooting<\/font><\/h5>\n<p>If you need to troubleshoot the communication between the Citrix XML service and the IMA farm (XenApp) or Desktop Delivery Controller I would recommend you to read the following articles of <a href=\"https:\/\/de.linkedin.com\/in\/nicholasdille\" target=\"_blank\">Nicholas Dille<\/a>:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2008\/07\/17\/talking-to-the-xml-service-update\/\" target=\"_blank\">Talking to the XML Service<\/a> <\/li>\n<li>Debugging Using XmlServiceExplorer <a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2008\/07\/22\/debugging-using-xmlserviceexplorer-part-1\" target=\"_blank\">Part 1<\/a>, <a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2008\/07\/24\/debugging-using-xmlserviceexplorer-part-2\" target=\"_blank\">Part 2<\/a> and <a href=\"https:\/\/www.sepago.de\/d\/nicholas\/2008\/07\/31\/debugging-using-xmlserviceexplorer-part-3\" target=\"_blank\">Part 3<\/a> <\/li>\n<\/ul>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<h4><font style=\"font-weight: bold\">2. The Secure Ticket Authority (STA)<\/font><\/h4>\n<h5><font style=\"font-weight: bold\">Introduction<\/font><\/h5>\n<p>The Secure Ticket Authority (STA) is introduced with the Citrix Secure Gateway 1.0 (released around 2001). Before the release of Presentation Server 4.0 (released in <a href=\"https:\/\/www.brianmadden.com\/blogs\/brianmadden\/archive\/2004\/10\/12\/a-look-at-the-new-features-of-citrix-metaframe-presentation-server-4.aspx\" target=\"_blank\">2004<\/a>) the STA was a separately installed component that required Microsoft IIS to host the service. With Presentation Server 4.0 (and all future releases) it is part of the <strong>Citrix XML service<\/strong>. In this article I\u2019m <strong>assuming<\/strong> your using PS4.0 or later and therefore the STA server is integrated in the XML server.<\/p>\n<p>The STA generates and validates secure tickets that <strong>authorize<\/strong> users to traverse a Secure Gateway or Access Gateway to a XenApp\/XenDesktop farm. In a CSG deployment the gateway server does not perform authentication of incoming request. Instead the gateway defers <strong>authentication <\/strong>to an STA server to guarantee that each server is authenticated. If users have valid STA tickets, the gateway assumes that the passed the authentication checks and should be permitted access.<\/p>\n<p><em>Note the difference between those authentication and authorization. <strong>Authentication <\/strong>is a process where credentials (or a token, etc.) are verified against an directory service (like Active Directory) or a RADIUS server to verify the user is who it claims to be. An <strong>authorization <\/strong>process is verifying if the user is allowed to access \/ use a resource<\/em><\/p>\n<p>The Secure Ticket Authority (STA) is accessed via <em>\/Scripts\/CtxSta.dll<\/em>.<\/p>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\">Authentication<\/font><\/h5>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Web-Interface-Specify-Point-of-Authentication.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Web Interface - Specify Point of Authentication\" border=\"0\" alt=\"Web Interface - Specify Point of Authentication\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Web-Interface-Specify-Point-of-Authentication_thumb.png\" width=\"154\" height=\"125\" \/><\/a>On the WebInterface you specify where the <strong>authentication<\/strong> takes place. This is the component that <strong>validates<\/strong> the credentials, token, etc. of the user to verify the user is who he says it is. It will then <strong>request <\/strong>a secure ticket from one STA for <strong>each <\/strong>farm (as specified in the Web Sites \/ Services Sites). The ticket and its corresponding data remains in memory at the STA for a configurable number of seconds (100 by default). The ticket can only be used <em>once<\/em>, so they are deleted after use.<\/p>\n<p>The STA ticket is stored in the <strong>Address<\/strong> property of the <em>launch.ica<\/em> that is provided by the WebInterface. For more information about the content of ICA file please read the article <a href=\"https:\/\/ingmarverheij.com\/en\/2012\/07\/the-citrix-ica-file-explained-and-demystified\/\" target=\"_blank\">The Citrix ICA file explained and demystified<\/a>.<\/p>\n<p>Whenever a <strong>secure <\/strong>session is initiated (the user launches an application or desktop) the traversed <strong>components <\/strong>(like CAG, CSG or MSAM) only has to <strong>validate <\/strong>the ticket at the STA. If the STA <strong>confirms <\/strong>the ticket is valid, access is granted.&#160; <em>This is why it is <strong>important <\/strong>that all components (WebInterface, Storefront, Netscaler, Access Gateway, Secure Gateway, etc.) point to the same STA servers.<\/em><\/p>\n<h5><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Web-Interface-Manage-Server-Farms.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Web Interface - Manage Server Farms\" border=\"0\" alt=\"Web Interface - Manage Server Farms\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Web-Interface-Manage-Server-Farms_thumb.png\" width=\"159\" height=\"104\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Secure-Gateway-Configuration-STA.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Secure Gateway Configuration - STA\" border=\"0\" alt=\"Secure Gateway Configuration - STA\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Secure-Gateway-Configuration-STA_thumb.png\" width=\"113\" height=\"104\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Secure-Gateway-Configuration-STA-Details.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Secure Gateway Configuration - STA - Details\" border=\"0\" alt=\"Secure Gateway Configuration - STA - Details\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Secure-Gateway-Configuration-STA-Details_thumb.png\" width=\"113\" height=\"104\" \/><\/a> <\/p>\n<p>  <br clear=\"all\" \/><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/NetScaler-Bind-Unbind-STA-Servers.gif\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"NetScaler - Bind-Unbind STA Servers\" border=\"0\" alt=\"NetScaler - Bind-Unbind STA Servers\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/NetScaler-Bind-Unbind-STA-Servers_thumb.gif\" width=\"159\" height=\"98\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Storefront-Manage-Secure-Ticket-Authority-Settings.gif\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Storefront - Manage Secure Ticket Authority Settings\" border=\"0\" alt=\"Storefront - Manage Secure Ticket Authority Settings\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Storefront-Manage-Secure-Ticket-Authority-Settings_thumb.gif\" width=\"109\" height=\"98\" \/><\/a> <\/p>\n<p>  <br clear=\"all\" \/><\/h5>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<h5><font style=\"font-weight: bold\">Identification<\/font><\/h5>\n<p>Each Secure Ticket Authority is <strong>identified<\/strong> by an <strong>unique<\/strong> identifier&#160; that consists of a sequence of 0 \u2013 16 characters representing the STA. This unique identifier is used in the ICA file (in the Address property) to <strong>direct<\/strong> the traversed components (like NetScaler, CAG, CSG, etc.) to the STA that issued the secure ticket. In version 1.x this string defaults to STA01, STA02 and so on. Since STA 2.x the STA ID is a hash of the server name (<em>STAB57127594AE9 <\/em>in the example screenshots above).<\/p>\n<p>If there is a mismatch or a duplicate identifier, the wrong STA is requested to validate the secure ticket (who hasn\u2019t issued the ticket , and therefore stored in memory) resulting in an authentication failure.<\/p>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\">Versions<\/font><\/h5>\n<p>In time the STA is developed to support more <strong>features<\/strong>, as a result multiple <strong>versions<\/strong> of the STA exist. All versions of Web Interface (WI), Secure Gateway (CSG), MetaFrame Secure Access Manager (MSAM) and Access Gateway (CAG) are compatible with all versions of STA, but not all features are available. <\/p>\n<p>On a high level the following features are added<\/p>\n<ul>\n<li><strong>1.0<\/strong>: Initial release <\/li>\n<li><strong>1.1: <\/strong>No material functional differences <\/li>\n<li><strong>2.0 (released with CSG 2.0 \/ MSAM 2.0)<\/strong>: Session details in Secure Gateway Management console (N\/A is shown) <\/li>\n<li><strong>2.2 (released with MSAM 2.2)<\/strong>: Advanced Gateway Client features <\/li>\n<li><strong>4.0 (released with CSG 3.0 \/ PS 4.0)<\/strong>&#160;<strong>: <\/strong>Session reliability through the gateway + XML service integration <\/li>\n<\/ul>\n<p>More information about STA compatibility with other Citrix products can be read in <a href=\"https:\/\/support.citrix.com\/article\/CTX108302\/\" target=\"_blank\">CTX108302<\/a>.<\/p>\n<p>&#160;<\/p>\n<h5><font style=\"font-weight: bold\"><\/font><\/h5>\n<h5><font style=\"font-weight: bold\">Ticket content<\/font><\/h5>\n<p>Both request and response are carried out as an XML request\/response document (hence why the integrated the STA in the XML service). The encoding format is a string of the form<\/p>\n<p><font face=\"Courier New\">;STA_VERSION;STA_ID;TICKET<\/font><\/p>\n<ul>\n<li><strong>STA_VERSION<\/strong>: A numeric field that identifies the STA version . 10 stands for 1.0\/1.1, 20 for 2.0, etc. <\/li>\n<li><strong>STA_ID<\/strong>: The identifier of the STA (for example <em>STAB57127594AE9)<\/em> <\/li>\n<li><strong>TICKET<\/strong>: a randomly-generated sequence of 32 uppercase alphabetic or numeric characters. <\/li>\n<\/ul>\n<p>For example: <font face=\"Courier New\">;10;STAB57127594AE9;770E4AE99C332CA3757361DD716A0CF2 <\/font><\/p>\n<p><font face=\"Courier New\"><br \/>\n    <br \/><\/font><\/p>\n<h5><font style=\"font-weight: bold\">Troubleshooting<\/font><\/h5>\n<p>If you need to troubleshoot an issue with the STA I would recommend to enable logging first. Logging can be enabled in the <em>CtxSta.config<\/em> file which can be found in <em>%ProgramFiles%\\Citrix\\System32 <\/em>on a 32-bit operating system and <em>%ProgramFiles(x86)%\\Citrix\\System32<\/em> on a 64-bit operating system. In this file you need to set <font face=\"Courier New\">LogLevel=3<\/font> and restart the Citrix XML service. By default the logfiles are stored in <em>..\\Logs<\/em>.<\/p>\n<p>In the <em>CtxSta.config<\/em> you can also verify and change the unique identifier (UID) of the STA and change other settings.<\/p>\n<p>&#160;<\/p>\n<p><strong><\/strong><\/p>\n<p><strong>Protocol Driver Error<\/strong><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Protocol-Driver-error.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Protocol Driver error\" border=\"0\" alt=\"Protocol Driver error\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Protocol-Driver-error_thumb.png\" width=\"154\" height=\"77\" \/><\/a>A common error is the \u2018protocol driver error\u2019 when you connect to a published resource via a Citrix Access Gateway (CAG).&#160; This error can be caused by a missing (or misconfigured) STA server in the Access Gateway.<\/p>\n<p>&#160;<\/p>\n<p>Each secure ticket authority (STA) server that is specified in the secure access settings of the WebInterface, needs to be configured in the CAG as well. If the STA is missing in the CAG it might not validate the secure ticket. <\/p>\n<p>This is because the ICA file contains the identifier of the STA server (in the Address field) and that needs to be validated by the CAG. If the identifier of the STA is not specified in the CAG, it doesn\u2019t know what server issued the ticket and therefore can\u2019t verify it.<\/p>\n<h2><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/NetScaler-Configure-Access-Gateway-Virtual-Server_Ingmar-VerheijDiskStation_aug-22-1225-20121.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"NetScaler - Configure Access Gateway Virtual Server\" border=\"0\" alt=\"NetScaler - Configure Access Gateway Virtual Server\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/NetScaler-Configure-Access-Gateway-Virtual-Server_Ingmar-VerheijDiskStation_aug-22-1225-2012_t1.png\" width=\"154\" height=\"127\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Specify-Secure-Ticket-Authority-Settings.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Specify Secure Ticket Authority Settings\" border=\"0\" alt=\"Specify Secure Ticket Authority Settings\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/08\/Specify-Secure-Ticket-Authority-Settings_thumb.png\" width=\"266\" height=\"127\" \/><\/a><\/h2>\n<p>&#160;<\/p>\n<h2>Comments<\/h2>\n<p>Have a question or suggestion? Let me know in the <strong><a href=\"https:\/\/ingmarverheij.com\/en\/2012\/08\/the-citrix-xml-server-explained-and-demystified\/\">comments<\/a><\/strong>.<\/p>","protected":false},"excerpt":{"rendered":"<p>The Citrix XML server is a component of Citrix XenApp and XenDesktop that\u2019s used to enumerates available resources&#160; and provide secure tickets for users that&#160; to use the&#160; WebInterface or CloudGateway. &#160; In this article I\u2019ll explain what the services the XML service provide, how it does it job and all you need to know [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[19,571,305,54],"tags":[667,402,492,499,501,500,174],"class_list":["post-4264","post","type-post","status-publish","format-standard","hentry","category-citrix","category-demystified-other","category-xenapp-presentation-server","category-xendesktop","tag-citrix","tag-cloudgateway","tag-demystified","tag-sta","tag-storefront","tag-webinterface","tag-xml"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=4264"}],"version-history":[{"count":18,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4264\/revisions"}],"predecessor-version":[{"id":4759,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4264\/revisions\/4759"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=4264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=4264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=4264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}