<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://textserver.lsi.upc.edu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Padro</id>
		<title>Textserver wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://textserver.lsi.upc.edu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Padro"/>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php/Special:Contributions/Padro"/>
		<updated>2026-07-11T08:05:22Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Executing_Services&amp;diff=173</id>
		<title>Executing Services</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Executing_Services&amp;diff=173"/>
				<updated>2019-07-18T15:01:16Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Interactive and Batch requests ==&lt;br /&gt;
&lt;br /&gt;
Services can be called in two ways: Manually via a browser web interface, or programmatically via a client program running on your side. See below for details on each of them.&lt;br /&gt;
&lt;br /&gt;
Both ways allow submitting either interactive or batch requests.&lt;br /&gt;
&lt;br /&gt;
Interactive requests are served immediately (or an error is returned if it is not possible to attend the request). &lt;br /&gt;
The client is blocked until the end of the request.&lt;br /&gt;
Interactive requests are intended for analyzing relatively short documents where processing time is a vital factor.&lt;br /&gt;
&lt;br /&gt;
Batch requests are queued and processed as soon as possible.&lt;br /&gt;
The client receives a job id code that can be used later to retrieve the results of the processing.&lt;br /&gt;
Batch requests are intended to analyze long documents or large multidocument collections, or when processing time is not a vital factor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Batch requests take as input ZIP files containing one or more plain text files.&lt;br /&gt;
Interactive requests take as input plain text (in a form text box) or a single plain text file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting Jobs via Web Browser ==&lt;br /&gt;
&lt;br /&gt;
A registered user can submit a text for analysis from the &amp;quot;Execute&amp;quot; form in the [[Service Catalog]].&lt;br /&gt;
The form will require the user to select the type of request (Interactive/Batch), to provide the service parameters (e.g. language, desired output format...), and the text to be analyzed (either writting it in a text box or uploading a file).&lt;br /&gt;
&lt;br /&gt;
When clicking &amp;quot;Execute&amp;quot; the request will be sent.  If it is a batch request, the user will get a job id for later [[Retrieving_Batch_Results|result retrieval]]. If it is an interactive request, the user will get a file in the desired output format (XML, json, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting Jobs via a Remote Client ==&lt;br /&gt;
&lt;br /&gt;
TextServer becomes most useful when used from a remote client. This allows you to integrate into your application the results of our language analyzers.&lt;br /&gt;
&lt;br /&gt;
To call TextServer services from a remote client you need a program that sends a POST request with the right parameters to the right URL. &lt;br /&gt;
Since this is easier to say than to do, we provide a set of [[Example Clients|example clients]] you can use as a basis to write your own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Retrieving Results for a Batch Request ==&lt;br /&gt;
&lt;br /&gt;
When the user submits a batch request, TextServer responds with a Token ID that will identify the job and allow retrieval of the results when it is done.&lt;br /&gt;
&lt;br /&gt;
The user can retrieve the results manually in the web page, or programmatically from a remote client. &lt;br /&gt;
[[Example Clients|Example clients]] to retrieve batch requests results are provided.&lt;br /&gt;
&lt;br /&gt;
TextServer will notify the user via email when the job is finished. Alteratively, the user can poll TextServer periodically to find out whether job results are ready.&lt;br /&gt;
&lt;br /&gt;
When the user attempts to retrieve the results of an unfinished job, TextServer will respond with a HTTP 503 error message (Service Unavailable) containing the TextServer error code TS-125 (job not finished) in the message body.&lt;br /&gt;
&lt;br /&gt;
The retrieval can be done to the user convenience (e.g. the same client can send the request and sleep for a while before polling the server to get the results, or you can have an independent cron job that polls for all sent requests once every hour, or you can add a trigger in your mail that will launch the retrieval when the &amp;quot;job completed&amp;quot; mail is received, etc.)&lt;br /&gt;
&lt;br /&gt;
== What if I get &amp;quot;NO SERVERS AVAILABLE&amp;quot; ?  ==&lt;br /&gt;
&lt;br /&gt;
TextServer keeps an array of loaded servers for each provided service. &lt;br /&gt;
If the service is not requested, the servers are stopped to save resources. &lt;br /&gt;
If a request arrives and there are no running servers (or all loaded servers are busy), the user may get the &amp;quot;no servers available, try again later&amp;quot; error.  However, when this happens, TextServer launches new servers.  So, if the request is sent again after a short time, it will be attended by those newly created servers.&lt;br /&gt;
&lt;br /&gt;
Notice that depending on the service, loading a server may take some time (from a few seconds to a couple of minutes), so it is wise to wait a reasonable time before sending the request again.&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Executing_Services&amp;diff=170</id>
		<title>Executing Services</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Executing_Services&amp;diff=170"/>
				<updated>2019-07-18T10:01:41Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Interactive and Batch requests ==&lt;br /&gt;
&lt;br /&gt;
Services can be called in two ways: Manually via a browser web interface, or programmatically via a client program running on your side. See below for details on each of them.&lt;br /&gt;
&lt;br /&gt;
Both ways allow submitting either interactive or batch requests.&lt;br /&gt;
&lt;br /&gt;
Interactive requests are served immediately (or an error is returned if it is not possible to attend the request). &lt;br /&gt;
The client is blocked until the end of the request.&lt;br /&gt;
Interactive requests are intended for analyzing relatively short documents where processing time is a vital factor.&lt;br /&gt;
&lt;br /&gt;
Batch requests are queued and processed as soon as possible.&lt;br /&gt;
The client receives a job id code that can be used later to retrieve the results of the processing.&lt;br /&gt;
Batch requests are intended to analyze long documents or large multidocument collections, or when processing time is not a vital factor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Batch requests take as input ZIP files containing one or more plain text files.&lt;br /&gt;
Interactive requests take as input plain text (in a form text box) or a single plain text file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting Jobs via Web Browser ==&lt;br /&gt;
&lt;br /&gt;
A registered user can submit a text for analysis from the &amp;quot;Execute&amp;quot; form in the [[Service Catalog]].&lt;br /&gt;
The form will require the user to select the type of request (Interactive/Batch), to provide the service parameters (e.g. language, desired output format...), and the text to be analyzed (either writting it in a text box or uploading a file).&lt;br /&gt;
&lt;br /&gt;
When clicking &amp;quot;Execute&amp;quot; the request will be sent.  If it is a batch request, the user will get a job id for later [[Retrieving_Batch_Results|result retrieval]]. If it is an interactive request, the user will get a file in the desired output format (XML, json, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Submitting Jobs via a Remote Client ==&lt;br /&gt;
&lt;br /&gt;
TextServer becomes most useful when used from a remote client. This allows you to integrate into your application the results of our language analyzers.&lt;br /&gt;
&lt;br /&gt;
To call TextServer services from a remote client you need a program that sends a POST request with the right parameters to the right URL. &lt;br /&gt;
Since this is easier to say than to do, we provide a set of [[Example Clients|example clients]] you can use as a basis to write your own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Retrieving Results for a Batch Request ==&lt;br /&gt;
&lt;br /&gt;
When the user submits a batch request, TextServer responds with a Token ID that will identify the job and allow retrieval of the results when it is done.&lt;br /&gt;
&lt;br /&gt;
The user can retrieve the results manually in the web page, or programmatically from a remote client. &lt;br /&gt;
[[Example Clients|Example clients]] to retrieve batch requests results are provided.&lt;br /&gt;
&lt;br /&gt;
TextServer will notify the user via email when the job is finished. Alteratively, the user can poll TextServer periodically to find out whether job results are ready.&lt;br /&gt;
&lt;br /&gt;
When the user attempts to retrieve the results of an unfinished job, TextServer will respond with a HTTP 503 error message (Service Unavailable) containing the TextServer error code TS-125 (job not finished) in the message body.&lt;br /&gt;
&lt;br /&gt;
The retrieval can be done to the user convenience (e.g. the same client can send the request and sleep for a while before polling the server to get the results, or you can have an independent cron job that polls for all sent requests once every hour, or you can add a trigger in your mail that will launch the retrieval when the &amp;quot;job completed&amp;quot; mail is received, etc.)&lt;br /&gt;
&lt;br /&gt;
== What if I get &amp;quot;NO SERVERS AVAILABLE&amp;quot; ?  ==&lt;br /&gt;
&lt;br /&gt;
TextServer keeps a battery of loaded servers for each provided service. &lt;br /&gt;
If the service is not requested, the servers are stopped to save resources. &lt;br /&gt;
If a request arrives and there are no loaded services (or all loaded services are busy), the user may get the &amp;quot;no servers available, try again later&amp;quot; error.  However, when this happens, TextServer launches new servers.  So, if the request is sent again, it will be attended by those newly created servers.&lt;br /&gt;
&lt;br /&gt;
Notice that depending on the service, loading a server may take some time (from a few seconds to a couple of minutes), so it is wise to wait a reasonable time before sending the request again.&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=168</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=168"/>
				<updated>2019-04-03T15:39:16Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = input('Text to analyze: ')&lt;br /&gt;
lang = input('Language: ')&lt;br /&gt;
out = input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = input('TextServer Username: ')&lt;br /&gt;
pwd = input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username':user,&lt;br /&gt;
                'password':pwd,&lt;br /&gt;
                'text_input':text,&lt;br /&gt;
                'language':lang,&lt;br /&gt;
                'output':out,&lt;br /&gt;
                'interactive':'1' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print(resp.text)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=164</id>
		<title>Python3 Batch Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=164"/>
				<updated>2018-08-24T09:33:55Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
fname = raw_input('Input ZIP file: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username' : user&lt;br /&gt;
                'password' : pwd,&lt;br /&gt;
                'file' : open(fname,&amp;quot;rb&amp;quot;),&lt;br /&gt;
                'language': lang,&lt;br /&gt;
                'output': out,&lt;br /&gt;
                'interactive' : '0' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error. Server response should include a job tokenID, retrieve it&lt;br /&gt;
dom = xml.etree.ElementTree.XML(resp)&lt;br /&gt;
tkid = dom.text &lt;br /&gt;
print (&amp;quot;Job sumbitted. Token id=&amp;quot;,tkid)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python3&amp;diff=163</id>
		<title>Batch Results Retrieval in Python3</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python3&amp;diff=163"/>
				<updated>2018-08-24T09:33:13Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
tkid = raw_input('TextServer Job Token ID: ')&lt;br /&gt;
outfname = raw_input('Output ZIP file: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username' : user&lt;br /&gt;
                'tokenID' : tkid &lt;br /&gt;
               }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/resultRetrieve&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# no error, save results to output file&lt;br /&gt;
outf=open(outfname, 'w+')&lt;br /&gt;
print(resp, file=outf)&lt;br /&gt;
outf.close()&lt;br /&gt;
print &amp;quot;Job finished. Results saved to&amp;quot;,outfname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=162</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=162"/>
				<updated>2018-08-24T09:29:52Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: /* Example Clients for Retrieving Results of Batch Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python3]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Batch Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Batch Client|Python3]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python2|Python2]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Python3|Python3]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python2&amp;diff=161</id>
		<title>Batch Results Retrieval in Python2</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python2&amp;diff=161"/>
				<updated>2018-08-24T09:29:36Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #! /usr/bin/python  ######################################################################## # #  Example client to retrieve the resu...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to retrieve the results of a batch request to TextServer &lt;br /&gt;
#&lt;br /&gt;
#  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
# the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
# import required libraries&lt;br /&gt;
import urllib2&lt;br /&gt;
# You may need to install &amp;quot;poster&amp;quot; python module for these two:&lt;br /&gt;
from poster.encode import multipart_encode&lt;br /&gt;
from poster.streaminghttp import register_openers&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Register the streaming http handlers with urllib2&lt;br /&gt;
register_openers()&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
tkid = raw_input('TextServer Job Token ID: ')&lt;br /&gt;
outfname = raw_input('Output ZIP file: ')&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
TextServer_URL = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# prepare request to poll for completion and retrieve results&lt;br /&gt;
datagen, headers = multipart_encode({'username' : user,&lt;br /&gt;
                                     'tokenID' : tkid&lt;br /&gt;
                                     })&lt;br /&gt;
request = urllib2.Request(TextServer_URL + &amp;quot;/resultRetrieve&amp;quot;, &lt;br /&gt;
                          datagen, &lt;br /&gt;
                          headers)&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
  # send request to check for results&lt;br /&gt;
  print &amp;quot;Polling server for job completion...&amp;quot;&lt;br /&gt;
  resp =  urllib2.urlopen(request).read()&lt;br /&gt;
  &lt;br /&gt;
except urllib2.HTTPError, e:&lt;br /&gt;
  if (e.code == 503 and e.read()[0:8] == &amp;quot;[TS-125]&amp;quot; ) :&lt;br /&gt;
    # http status 503, textserver code TS-125 means the job is not finished yet. &lt;br /&gt;
    print &amp;quot;Job not finished yet&amp;quot; &lt;br /&gt;
  else :      &lt;br /&gt;
    # some actual error happened. abort&lt;br /&gt;
    print e, &amp;quot;-&amp;quot;, e.read()&lt;br /&gt;
  exit()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
# no error, save results to output file&lt;br /&gt;
outf=open(outfname, 'w+')&lt;br /&gt;
print &amp;gt;&amp;gt;outf, resp&lt;br /&gt;
outf.close()&lt;br /&gt;
print &amp;quot;Job finished. Results saved to&amp;quot;,outfname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=160</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=160"/>
				<updated>2018-08-24T09:29:06Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: /* Example Clients for Retrieving Results of Batch Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python3]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Batch Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Batch Client|Python3]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python|Python]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Python2|Python2]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Python3|Python3]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=159</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=159"/>
				<updated>2018-08-24T09:27:48Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = raw_input('Text to analyze: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username':user&lt;br /&gt;
                'password':pwd,&lt;br /&gt;
                'text_input':text,&lt;br /&gt;
                'language':lang,&lt;br /&gt;
                'output':'xml',&lt;br /&gt;
                'interactive':'1' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print(resp.text)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=158</id>
		<title>Python3 Batch Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Batch_Client&amp;diff=158"/>
				<updated>2018-08-24T09:27:34Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #!/usr/bin/env python3  import requests import xml.etree.ElementTree  # set query elements fname = raw_input('Input ZIP file: ') lang...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
fname = raw_input('Input ZIP file: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username' : user&lt;br /&gt;
                'password' : pwd,&lt;br /&gt;
                'file' : open(fname,&amp;quot;rb&amp;quot;),&lt;br /&gt;
                'language': lang,&lt;br /&gt;
                'output': out,&lt;br /&gt;
                'interactive' : '0' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error. Server response should include a job tokenID, retrieve it&lt;br /&gt;
dom = xml.etree.ElementTree.XML(resp)&lt;br /&gt;
tkid = dom.text &lt;br /&gt;
print &amp;quot;Job sumbitted. Token id=&amp;quot;,tkid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=157</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=157"/>
				<updated>2018-08-24T09:24:10Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: /* Example Clients for Batch Jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python3]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Batch Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Batch Client|Python3]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python|Python]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python2_Batch_Client&amp;diff=156</id>
		<title>Python2 Batch Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python2_Batch_Client&amp;diff=156"/>
				<updated>2018-08-24T09:23:48Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #! /usr/bin/python  ######################################################################## # #  Example client to submit a batch re...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to submit a batch request to TextServer &lt;br /&gt;
# SERVICENAME service, and wait for the job to be finished.&lt;br /&gt;
#&lt;br /&gt;
#  Input must be a ZIP file containing one or more text files to analyze&lt;br /&gt;
#  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
# the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
# import required libraries&lt;br /&gt;
import urllib2&lt;br /&gt;
# You may need to install &amp;quot;poster&amp;quot; python module for these two:&lt;br /&gt;
from poster.encode import multipart_encode&lt;br /&gt;
from poster.streaminghttp import register_openers&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Register the streaming http handlers with urllib2&lt;br /&gt;
register_openers()&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
fname = raw_input('Input ZIP file: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
&lt;br /&gt;
# Encode query in a form-data.&lt;br /&gt;
# 'headers' contains the necessary Content-Type and Content-Length.&lt;br /&gt;
# 'datagen' is a generator object that yields the encoded parameters.&lt;br /&gt;
datagen, headers = multipart_encode({'username' : user,&lt;br /&gt;
                                     'password' : pwd,&lt;br /&gt;
                                     'file' : open(fname,&amp;quot;rb&amp;quot;),&lt;br /&gt;
                                     'language' : lang,&lt;br /&gt;
                                     'output' : out,&lt;br /&gt;
                                     'interactive':'0'&lt;br /&gt;
                                     } )&lt;br /&gt;
# service URL&lt;br /&gt;
TextServer_URL = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Create the Request object&lt;br /&gt;
request = urllib2.Request(TextServer_URL + &amp;quot;/processQuery/&amp;quot; + service,&lt;br /&gt;
                          datagen, &lt;br /&gt;
                          headers)&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
  # Actually do the request, and get the response&lt;br /&gt;
  resp =  urllib2.urlopen(request).read()&lt;br /&gt;
&lt;br /&gt;
except urllib2.HTTPError, e:&lt;br /&gt;
  # handle connection errors&lt;br /&gt;
  print e, &amp;quot;-&amp;quot;, e.read()&lt;br /&gt;
  exit()&lt;br /&gt;
&lt;br /&gt;
# Server response should include a job tokenID, retrieve it&lt;br /&gt;
dom = xml.etree.ElementTree.XML(resp)&lt;br /&gt;
tkid = dom.text &lt;br /&gt;
print &amp;quot;Job sumbitted. Token id=&amp;quot;,tkid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=155</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=155"/>
				<updated>2018-08-24T09:23:42Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
from xml.dom.minidom import parseString&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = raw_input('Text to analyze: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username':user&lt;br /&gt;
                'password':pwd,&lt;br /&gt;
                'text_input':text,&lt;br /&gt;
                'language':lang,&lt;br /&gt;
                'output':'xml',&lt;br /&gt;
                'interactive':'1' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print(resp.text)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=154</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=154"/>
				<updated>2018-08-24T09:23:06Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: /* Example Clients for Batch Jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python3]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python Batch Client|Python]]'''&lt;br /&gt;
* '''[[Python2 Batch Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Batch Client|Python3]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python|Python]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=153</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=153"/>
				<updated>2018-08-24T09:15:33Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
from xml.dom.minidom import parseString&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = raw_input('Text to analyze: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username':user&lt;br /&gt;
                'password':pwd,&lt;br /&gt;
                'text_input':text,&lt;br /&gt;
                'language':lang,&lt;br /&gt;
                'output':'xml',&lt;br /&gt;
                'interactive':'1' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# HTTP error, raise exception&lt;br /&gt;
if resp.status_code != requests.codes.ok : &lt;br /&gt;
   resp.raise_for_status()&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print(resp.text)&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=152</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=152"/>
				<updated>2018-08-24T09:12:39Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
from xml.dom.minidom import parseString&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = raw_input('Text to analyze: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
 &lt;br /&gt;
# Create request&lt;br /&gt;
request_data = {'username':user&lt;br /&gt;
                'password':pwd,&lt;br /&gt;
                'text_input':text,&lt;br /&gt;
                'language':lang,&lt;br /&gt;
                'output':'xml',&lt;br /&gt;
                'interactive':'1' }&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Send request and get response    &lt;br /&gt;
resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print(resp.text)&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=151</id>
		<title>Python3 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python3_Interactive_Client&amp;diff=151"/>
				<updated>2018-08-24T08:55:53Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #!/usr/bin/env python3  import requests  # necesari per a la conexio al textserver import requests from xml.dom.minidom import parseS...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
# necesari per a la conexio al textserver&lt;br /&gt;
import requests&lt;br /&gt;
from xml.dom.minidom import parseString&lt;br /&gt;
  # Create request&lt;br /&gt;
    request_data = {'username':'jofre',&lt;br /&gt;
                    'password':'jofre.123',&lt;br /&gt;
                    'text_input':text,&lt;br /&gt;
                    'language':lang,&lt;br /&gt;
                    'output':'xml',&lt;br /&gt;
                    'interactive':'1' }&lt;br /&gt;
    url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/tagger&amp;quot;&lt;br /&gt;
    # Send request and get response    &lt;br /&gt;
    resp = requests.post(url, files=request_data)&lt;br /&gt;
&lt;br /&gt;
    # process response (posar-la en el format adqueat pel RegexpParser)&lt;br /&gt;
    xml = parseString(resp.text)&lt;br /&gt;
    result = []&lt;br /&gt;
    for s in xml.getElementsByTagName(&amp;quot;sentence&amp;quot;):&lt;br /&gt;
        tks = []&lt;br /&gt;
        for t in s.getElementsByTagName(&amp;quot;token&amp;quot;) :&lt;br /&gt;
            tks.append((t.attributes[&amp;quot;form&amp;quot;].value, t.attributes[&amp;quot;tag&amp;quot;].value))&lt;br /&gt;
            &lt;br /&gt;
        result.append(tks)&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Python2_Interactive_Client&amp;diff=150</id>
		<title>Python2 Interactive Client</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Python2_Interactive_Client&amp;diff=150"/>
				<updated>2018-08-24T08:53:20Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt; #! /usr/bin/python  ######################################################################## # #  Example client to submit an interac...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to submit an interactive request to TextServer &lt;br /&gt;
# SERVICENAME service. &lt;br /&gt;
#  Input may be a plain text or a text file.  No ZIP files.&lt;br /&gt;
#  Output will be in the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
# import required libraries&lt;br /&gt;
import urllib2&lt;br /&gt;
# You may need to install &amp;quot;poster&amp;quot; python module for these two:&lt;br /&gt;
from poster.encode import multipart_encode&lt;br /&gt;
from poster.streaminghttp import register_openers&lt;br /&gt;
&lt;br /&gt;
# Register the streaming http handlers with urllib2&lt;br /&gt;
register_openers()&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
text = raw_input('Text to analyze: ')&lt;br /&gt;
lang = raw_input('Language: ')&lt;br /&gt;
out = raw_input('Output format (xml,json,conll,naf): ')&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
pwd = raw_input('TextServer Password: ')&lt;br /&gt;
&lt;br /&gt;
# Encode query in a form-data.&lt;br /&gt;
# 'headers' contains the necessary Content-Type and Content-Length.&lt;br /&gt;
# 'datagen' is a generator object that yields the encoded parameters.&lt;br /&gt;
datagen, headers = multipart_encode({'username':user,&lt;br /&gt;
                                     'password':pwd,&lt;br /&gt;
                                     'text_input':text,&lt;br /&gt;
                                     'language':lang,&lt;br /&gt;
                                     'output':out,&lt;br /&gt;
                                     'interactive':'1'&lt;br /&gt;
                                     } )&lt;br /&gt;
# service URL&lt;br /&gt;
service = &amp;quot;SERVICENAME&amp;quot;&lt;br /&gt;
url = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws/processQuery/&amp;quot;+service&lt;br /&gt;
&lt;br /&gt;
# Create the Request object&lt;br /&gt;
request = urllib2.Request(url, datagen, headers)&lt;br /&gt;
try:&lt;br /&gt;
  # Actually do the request, and get the response&lt;br /&gt;
  resp =  urllib2.urlopen(request).read()&lt;br /&gt;
&lt;br /&gt;
except urllib2.HTTPError, e:&lt;br /&gt;
  # handle connection errors&lt;br /&gt;
  print e, &amp;quot;-&amp;quot;, e.read()&lt;br /&gt;
  exit()&lt;br /&gt;
&lt;br /&gt;
# No error, appropriately process response&lt;br /&gt;
# (e.g. parsing XML or JSON, and doing clever stuff with the content)&lt;br /&gt;
print resp&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=149</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=149"/>
				<updated>2018-08-24T08:52:22Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: /* Example Clients for Interactive Jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python3]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python Batch Client|Python]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python|Python]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=148</id>
		<title>Example Clients</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Example_Clients&amp;diff=148"/>
				<updated>2018-08-24T08:52:09Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.&lt;br /&gt;
&lt;br /&gt;
The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.&lt;br /&gt;
&lt;br /&gt;
Below you'll find a list of example client programs in different programming languages.&lt;br /&gt;
&lt;br /&gt;
The same code can be used to access any TextServer service with small variations:&lt;br /&gt;
&lt;br /&gt;
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
* Replace the parameters in the example client with the parametes that the called service requires. Rules are simple:&lt;br /&gt;
** Language identification service does not require a &amp;quot;language&amp;quot; parameter, but the other services do.&lt;br /&gt;
** All services require a &amp;quot;interactive&amp;quot; parameter stating whether the job is interactive or batch.&lt;br /&gt;
** All services require either a &amp;quot;text_input&amp;quot; parameter (for interactive jobs) or a &amp;quot;input_file&amp;quot; parameter (for batch jobs).&lt;br /&gt;
** You can find out the name of any other specific parameters for a service in the &amp;quot;Execute&amp;quot; form of your subscribed services.&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Interactive Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send an interactive request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the request to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
* '''[[Python2 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Python3 Interactive Client|Python2]]'''&lt;br /&gt;
* '''[[Java Interactive Client|Java]]'''&lt;br /&gt;
* '''[[Perl Interactive Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Interactive Client|PHP]]'''&lt;br /&gt;
* '''[[curl Interactive Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Batch Jobs ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of example of how to send a batch request to a service named &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; using different programming languages.&lt;br /&gt;
You'll need to replace &amp;lt;tt&amp;gt;SERVICENAME&amp;lt;/tt&amp;gt; with the actual name of the desired service, and adapt the list of parameters in the multipart form to those expected by the service.&lt;br /&gt;
&lt;br /&gt;
These clients send the request and obtain the job Token ID from TextServer. This Token ID can be used later to retrieve the results of the job&lt;br /&gt;
&lt;br /&gt;
* '''[[Python Batch Client|Python]]'''&lt;br /&gt;
* '''[[Java Batch Client|Java]]'''&lt;br /&gt;
* '''[[Perl Batch Client|Perl]]'''&lt;br /&gt;
* '''[[PHP Batch Client|PHP]]'''&lt;br /&gt;
* '''[[curl Batch Client|bash (using curl)]]'''&lt;br /&gt;
&lt;br /&gt;
== Example Clients for Retrieving Results of Batch Requests ==&lt;br /&gt;
&lt;br /&gt;
Below there is a list of examples of how to retrieve the result of a batch job from a remote client.&lt;br /&gt;
The client just needs the username and the job Token ID to get the results.&lt;br /&gt;
&lt;br /&gt;
* '''[[Batch Results Retrieval in Python|Python]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Java|Java]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in Perl|Perl]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in PHP|PHP]]'''&lt;br /&gt;
* '''[[Batch Results Retrieval in curl|bash (using curl)]]'''&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=147</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=147"/>
				<updated>2016-04-15T11:18:19Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;13&amp;quot;| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| TS-129 || File input has incorrect type. Cannot be a Zip file for interactive processing&lt;br /&gt;
|-&lt;br /&gt;
| TS-130 || Local interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-131 || Local batch queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-132 || Remote interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-133 || Remote batch queries not allowed &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| TS-126 || Maximum daily demo usage for this user and service reached.&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=146</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=146"/>
				<updated>2016-04-15T11:18:00Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot;| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| TS-129 || File input has incorrect type. Cannot be a Zip file for interactive processing&lt;br /&gt;
|-&lt;br /&gt;
| TS-130 || Local interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-131 || Local batch queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-132 || Remote interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-133 || Remote batch queries not allowed &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| TS-126 || Maximum daily demo usage for this user and service reached.&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=145</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=145"/>
				<updated>2016-04-15T11:17:27Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot;| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| TS-129 || File input has incorrect type. Cannot be a Zip file for interactive processing&lt;br /&gt;
|-&lt;br /&gt;
| TS-130 || Local interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-131 || Local batch queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-132 || Remote interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-133 || Remote batch queries not allowed &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| TS-126 || Maximum daily demo usage for this user and service reached.&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=144</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=144"/>
				<updated>2016-04-15T11:12:47Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=143</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=143"/>
				<updated>2016-04-15T11:12:28Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
.catlinks { display: none; }&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.js&amp;diff=142</id>
		<title>MediaWiki:Common.js</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.js&amp;diff=142"/>
				<updated>2016-04-15T11:10:23Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* Any JavaScript here will be loaded for all users on every page load. */&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.js&amp;diff=141</id>
		<title>MediaWiki:Common.js</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.js&amp;diff=141"/>
				<updated>2016-04-15T11:09:52Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;/* Any JavaScript here will be loaded for all users on every page load. */ document.onkeydown = function( e ) { 	if( e == null ) e = event 	if( testKey( e, 122 ) ) { //F11 		a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* Any JavaScript here will be loaded for all users on every page load. */&lt;br /&gt;
document.onkeydown = function( e ) {&lt;br /&gt;
	if( e == null ) e = event&lt;br /&gt;
	if( testKey( e, 122 ) ) { //F11&lt;br /&gt;
		appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function testKey( e, intKeyCode ) {&lt;br /&gt;
	if( window.createPopup )&lt;br /&gt;
		return e.keyCode == intKeyCode&lt;br /&gt;
	else&lt;br /&gt;
		return e.which == intKeyCode&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=140</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=140"/>
				<updated>2016-04-15T11:09:17Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=139</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=MediaWiki:Common.css&amp;diff=139"/>
				<updated>2016-04-15T11:08:46Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;/* CSS placed here will be applied to all skins */ #column-content { margin: 0 0 .6em 0; } #content { margin: 2.8em 0 0 0; } #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-se...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
#column-content { margin: 0 0 .6em 0; }&lt;br /&gt;
#content { margin: 2.8em 0 0 0; }&lt;br /&gt;
#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }&lt;br /&gt;
#p-cactions { left: .1em; }&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=138</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=138"/>
				<updated>2016-03-02T12:13:44Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot;| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| TS-129 || File input has incorrect type. Cannot be a Zip file for interactive processing&lt;br /&gt;
|-&lt;br /&gt;
| TS-130 || Local interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-131 || Local batch queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-132 || Remote interactive queries not allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-133 || Remote batch queries not allowed &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=137</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=137"/>
				<updated>2016-01-22T14:52:42Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;11&amp;quot;| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=136</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=136"/>
				<updated>2016-01-22T14:51:17Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;11&amp;quot;| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=135</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=135"/>
				<updated>2016-01-22T14:50:31Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;11&amp;quot;| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=134</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=134"/>
				<updated>2016-01-22T14:48:33Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=133</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=133"/>
				<updated>2016-01-22T14:47:49Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=132</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=132"/>
				<updated>2016-01-22T14:45:36Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | HTTP error !! style=&amp;quot;text-align:left;&amp;quot; | TS code !! style=&amp;quot;text-align:left;&amp;quot; | TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=131</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=131"/>
				<updated>2016-01-22T14:45:11Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! style=&amp;quot;text-align:right;&amp;quot; | HTTP error !! TS code !! TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=130</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=130"/>
				<updated>2016-01-22T14:44:13Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! HTTP error !! TS code !! TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 - Internal Server Error || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-114 || Wrong number of parameters / Missing required parameter / Invalid value 'X' for parameter 'Y'&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-122 || Service is disabled by the administrator&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 - Not Found || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 - Service Unavailable || TS-125 || Requested results are not ready. Process has not finished yet. &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 - Unauthorized || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 - Bad Request || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 - Forbidden || TS-200 || Access forbidden&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=129</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=129"/>
				<updated>2016-01-22T13:32:23Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!HTTP error&lt;br /&gt;
!TS code&lt;br /&gt;
!TS error reason&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 || TS-100 || Internal server error &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 || TS-101 || Error executing the task  &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 || TS-102 || Error retrieving the result&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 || TS-103 || Couldn't find a server for the task. Try again later&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-110 || Input file doesn't match with the available demo file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-111 || Error validating file&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 500 || TS-112 || Error saving file input&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 || TS-113 || Requested demo doesn't exists&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-114 || Wrong number of parameters&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-115 || File input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-116 || Text input is not allowed for this service and client application&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-117 || Text is longer than the maximum allowed&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-118 || File is longer than the maximum&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-119 || No input given&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 || TS-120 || Wrong username or password&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 || TS-122 || Service is disabled &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 404 || TS-123 || Service not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-124 || Configuration parameter not found&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 503 || TS-125 || Requested file is not ready. Process has not finished yet. &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 401 || TS-126 || This user can't use the requested service&lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-127 || File input has incorrect type. Must be a zip file &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 400 || TS-128 || Batch processing not available with this input type &lt;br /&gt;
|-&lt;br /&gt;
| HTTP 403 || TS-200 || Access forbidden&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=128</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=128"/>
				<updated>2016-01-22T13:27:16Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!TS code&lt;br /&gt;
!TS error reason&lt;br /&gt;
!HTTP error&lt;br /&gt;
|-&lt;br /&gt;
|TS-100 || Internal server error || HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-101 || Error executing the task || HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-102 || Error retrieving the result ||HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-103 || Couldn't find a server for the task. Try again later || HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-110 || Input file doesn't match with the available demo file || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-111 || Error validating file || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-112 || Error saving file input || HTTP 500&lt;br /&gt;
|-&lt;br /&gt;
|TS-113 || Requested demo doesn't exists || HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-114 || Wrong number of parameters || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-115 || File input is not allowed for this service and client application || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-116 || Text input is not allowed for this service and client application || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-117 || Text is longer than the maximum allowed || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-118 || File is longer than the maximum || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-119 || No input given || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-120 || Wrong username or password || HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-122 || Service is disabled || HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-123 || Service not found || HTTP 404&lt;br /&gt;
|-&lt;br /&gt;
|TS-124 || Configuration parameter not found || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-125 || Requested file is not ready. Process has not finished yet. || HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-126 || This user can't use the requested service || HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-127 || File input has incorrect type. Must be a zip file || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-128 || Batch processing not available with this input type || HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-200 || Access forbidden || HTTP 403&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=127</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=127"/>
				<updated>2016-01-22T13:22:01Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|TS-100&lt;br /&gt;
|Internal server error&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-101&lt;br /&gt;
|Error executing the task&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-102&lt;br /&gt;
|Error retrieving the result&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-103&lt;br /&gt;
|Couldn't find a server for the task. Try again later&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-110&lt;br /&gt;
|Input file doesn't match with the available demo file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-111&lt;br /&gt;
|Error validating file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-112&lt;br /&gt;
|Error saving file input&lt;br /&gt;
|HTTP 500&lt;br /&gt;
|-&lt;br /&gt;
|TS-113&lt;br /&gt;
|Requested demo doesn't exists&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-114&lt;br /&gt;
|Wrong number of parameters&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-115&lt;br /&gt;
|File input is not allowed for this service and client application&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-116&lt;br /&gt;
|Text input is not allowed for this service and client application&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-117&lt;br /&gt;
|Text is longer than the maximum allowed&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-118&lt;br /&gt;
|File is longer than the maximum&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-119&lt;br /&gt;
|No input given&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-120&lt;br /&gt;
|Wrong username or password&lt;br /&gt;
|HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-122&lt;br /&gt;
|Service is disabled&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-123&lt;br /&gt;
|Service not found&lt;br /&gt;
|HTTP 404&lt;br /&gt;
|-&lt;br /&gt;
|TS-124&lt;br /&gt;
|Configuration parameter not found&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-125&lt;br /&gt;
|Requested file is not ready. Process has not finished yet.&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TS-126&lt;br /&gt;
|This user can't use the requested service&lt;br /&gt;
|HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-127&lt;br /&gt;
|File input has incorrect type. Must be a zip file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-128&lt;br /&gt;
|Batch processing not available with this input type&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-200&lt;br /&gt;
|Access forbidden&lt;br /&gt;
|HTTP 403&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=126</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=126"/>
				<updated>2016-01-22T13:20:49Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|TS-100&lt;br /&gt;
|Internal server error&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-101&lt;br /&gt;
|Error executing the task&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-102&lt;br /&gt;
|Error retrieving the result&lt;br /&gt;
|HTTP 500 &lt;br /&gt;
|-&lt;br /&gt;
|TS-103&lt;br /&gt;
|Couldn't find a server for the task. Try again later&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-110&lt;br /&gt;
|Input file doesn't match with the available demo file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-111&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Error validating file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-112&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;500&amp;quot;,&amp;quot;Error saving file input&lt;br /&gt;
|HTTP 500&lt;br /&gt;
|-&lt;br /&gt;
|TS-113&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;503&amp;quot;,&amp;quot;Requested demo doesn't exists&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-114&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Wrong number of parameters&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-115&lt;br /&gt;
|File input is not allowed for this service and client application&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-116&lt;br /&gt;
|Text input is not allowed for this service and client application&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-117&lt;br /&gt;
|Text is longer than the maximum allowed&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-118&lt;br /&gt;
|File is longer than the maximum&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-119&lt;br /&gt;
|No input given&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-120&lt;br /&gt;
|Wrong username or password&lt;br /&gt;
|HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-122&lt;br /&gt;
|Service is disabled&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|TS-123&lt;br /&gt;
|Service not found&lt;br /&gt;
|HTTP 404&lt;br /&gt;
|-&lt;br /&gt;
|TS-124&lt;br /&gt;
|Configuration parameter not found&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-125&lt;br /&gt;
|Requested file is not ready. Process has not finished yet.&lt;br /&gt;
|HTTP 503&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TS-126&lt;br /&gt;
|This user can't use the requested service&lt;br /&gt;
|HTTP 401&lt;br /&gt;
|-&lt;br /&gt;
|TS-127&lt;br /&gt;
|File input has incorrect type. Must be a zip file&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-128&lt;br /&gt;
|Batch processing not available with this input type&lt;br /&gt;
|HTTP 400&lt;br /&gt;
|-&lt;br /&gt;
|TS-200&lt;br /&gt;
|Access forbidden&lt;br /&gt;
|HTTP 403&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=125</id>
		<title>TextServer Error Codes</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Error_Codes&amp;diff=125"/>
				<updated>2016-01-22T13:10:51Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: Created page with &amp;quot;  When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
 When a request can not be served, TextServer will return an HTTP error code. The error message will contain an internal error code and a detailed explanation of the reason of the error.&lt;br /&gt;
&lt;br /&gt;
 Here is a list of TextServer error codes (&amp;lt;tt&amp;gt;TS-XXX&amp;lt;/tt&amp;gt;) and messages, together with HTTP error codes they are embedded in.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;100&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;500&amp;quot;,&amp;quot;Internal server error&amp;quot;&lt;br /&gt;
&amp;quot;101&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;500&amp;quot;,&amp;quot;Error executing the task&amp;quot;&lt;br /&gt;
&amp;quot;102&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;500&amp;quot;,&amp;quot;Error retrieving the result&amp;quot;&lt;br /&gt;
&amp;quot;103&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;503&amp;quot;,&amp;quot;Couldn't find a server for the task. Try again later&amp;quot;&lt;br /&gt;
&amp;quot;110&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Input file doesn't match with the available demo file&amp;quot;&lt;br /&gt;
&amp;quot;111&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Error validating file&amp;quot;&lt;br /&gt;
&amp;quot;112&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;500&amp;quot;,&amp;quot;Error saving file input&amp;quot;&lt;br /&gt;
&amp;quot;113&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;503&amp;quot;,&amp;quot;Requested demo doesn't exists&amp;quot;&lt;br /&gt;
&amp;quot;114&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Wrong number of parameters&amp;quot;&lt;br /&gt;
&amp;quot;115&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;File input is not allowed for this service and client application&amp;quot;&lt;br /&gt;
&amp;quot;116&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Text input is not allowed for this service and client application&amp;quot;&lt;br /&gt;
&amp;quot;117&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Text is longer than the maximum allowed&amp;quot;&lt;br /&gt;
&amp;quot;118&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;File is longer than the maximum&amp;quot;&lt;br /&gt;
&amp;quot;119&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;No input given&amp;quot;&lt;br /&gt;
&amp;quot;120&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;401&amp;quot;,&amp;quot;Wrong username or password&amp;quot;&lt;br /&gt;
&amp;quot;122&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;503&amp;quot;,&amp;quot;Service is disabled&amp;quot;&lt;br /&gt;
&amp;quot;123&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;404&amp;quot;,&amp;quot;Service not found&amp;quot;&lt;br /&gt;
&amp;quot;124&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Configuration parameter not found&amp;quot;&lt;br /&gt;
&amp;quot;125&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;503&amp;quot;,&amp;quot;Requested file is not ready. Process has not finished yet.&amp;quot;&lt;br /&gt;
&amp;quot;126&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;401&amp;quot;,&amp;quot;This user can't use the requested service&amp;quot;&lt;br /&gt;
&amp;quot;127&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;File input has incorrect type. Must be a zip file&amp;quot;&lt;br /&gt;
&amp;quot;128&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;400&amp;quot;,&amp;quot;Batch processing not available with this input type&amp;quot;&lt;br /&gt;
&amp;quot;200&amp;quot;,&amp;quot;en&amp;quot;,&amp;quot;403&amp;quot;,&amp;quot;Access forbidden&amp;quot;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Documentation&amp;diff=124</id>
		<title>TextServer Documentation</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=TextServer_Documentation&amp;diff=124"/>
				<updated>2016-01-22T13:06:40Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
TextServer is a platform of language analysis services that can be used to process texts either interactively or in batch mode.&lt;br /&gt;
&lt;br /&gt;
TextServer is powered by the High Performance Computing cluster in the [http://www.cs.upc.edu Computer Science Department] at [http://www.upc.edu UPC], that totals over 1,000 cores and 3TB of RAM.&lt;br /&gt;
&lt;br /&gt;
TextServer offers NLP services based on [http://nlp.lsi.upc.edu FreeLing] and other tools. Services range from language identification or tokenization to Semantic Role Labelling and Coreference Resolution. Services are offered for a variety of languages, including English, Spanish, Russian, French, German, Italian, Portuguese, Catalan, Galician, Welsch, among others.&lt;br /&gt;
&lt;br /&gt;
== TextServer goals ==&lt;br /&gt;
&lt;br /&gt;
TextServer aims to simplify the use of advanced Natural Language Processing pipelines such as FreeLing, moving them to the cloud and freeing the user from time-consuming installation procedures and complex library API calling. &lt;br /&gt;
&lt;br /&gt;
With TextServer, the user can just submit a document or collection for its processing, and get the results in XML or JSON, among other formats.&lt;br /&gt;
&lt;br /&gt;
The request can be sent manually via a web form, or programmatically from a remote client calling a web-service API.&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
&lt;br /&gt;
# [[Getting Started]]&lt;br /&gt;
# [[Service Catalog]]&lt;br /&gt;
# [[Executing Services]]&lt;br /&gt;
## [[Executing_Services#Submitting_Jobs_via_Web_Browser|Via Web browser]]&lt;br /&gt;
## [[Executing_Services#Submitting_Jobs_via_a_Remote_Client|Via remote client]]&lt;br /&gt;
## [[Executing_Services#Retrieving_Results_for_a_Batch_Request|Retrieving Batch Results]]&lt;br /&gt;
## [[Example Clients|Example Client Programs]]&lt;br /&gt;
## [[TextServer Error Codes]]&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_PHP&amp;diff=123</id>
		<title>Batch Results Retrieval in PHP</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_PHP&amp;diff=123"/>
				<updated>2016-01-21T11:32:10Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/php5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
//&lt;br /&gt;
// Example client to retrieve the results of a batch request to TextServer  &lt;br /&gt;
//&lt;br /&gt;
//  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
// the requested format (XML, json, conll)&lt;br /&gt;
//&lt;br /&gt;
/////////////////////////////////////////////////////////////////&lt;br /&gt;
  &lt;br /&gt;
  echo 'TextServer Username: '; $user = rtrim(fgets(STDIN));&lt;br /&gt;
  echo 'TextServer Job Token ID: '; $tkid = rtrim(fgets(STDIN));&lt;br /&gt;
  echo 'Output ZIP file: '; $outfile = rtrim(fgets(STDIN));&lt;br /&gt;
&lt;br /&gt;
  // build request&lt;br /&gt;
  $TextServer_URL=&amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // prepare request to poll for completion and retrieve results&lt;br /&gt;
  $h = curl_init();&lt;br /&gt;
  curl_setopt($h, CURLOPT_URL, $TextServer_URL.&amp;quot;/resultRetrieve&amp;quot;); &lt;br /&gt;
  curl_setopt($h, CURLOPT_POST, true);&lt;br /&gt;
  curl_setopt($h, CURLOPT_POSTFIELDS, array(&lt;br /&gt;
                                       'username' =&amp;gt; $user,&lt;br /&gt;
                                       'tokenID' =&amp;gt; $tkid,&lt;br /&gt;
                                      ) );&lt;br /&gt;
  curl_setopt($h, CURLOPT_HEADER, false);&lt;br /&gt;
  curl_setopt($h, CURLOPT_RETURNTRANSFER, 1);&lt;br /&gt;
&lt;br /&gt;
  // execute request   &lt;br /&gt;
  $result = curl_exec($h);&lt;br /&gt;
  // get status&lt;br /&gt;
  $err = curl_getinfo($h, CURLINFO_HTTP_CODE);&lt;br /&gt;
  // close connection&lt;br /&gt;
  curl_close($h);&lt;br /&gt;
&lt;br /&gt;
  if ($err == 503 and strpos($result, '[TS-125]')!==FALSE) {&lt;br /&gt;
    // http status 503, textserver code TS-125 means the job is not finished yet.&lt;br /&gt;
    print &amp;quot;Job not finished yet\n&amp;quot;;&lt;br /&gt;
    exit(0);&lt;br /&gt;
  }&lt;br /&gt;
  else if ($err !== 200) {&lt;br /&gt;
    // some other unexpected error happened. Report it&lt;br /&gt;
    print &amp;quot;HTTP &amp;quot;.$err.&amp;quot; - &amp;quot;.$result.&amp;quot;\n&amp;quot;;&lt;br /&gt;
    exit(1);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // response is ok, the job is done and we got the results. &lt;br /&gt;
  // write results to output ZIP file.&lt;br /&gt;
  $outf = fopen($outfile, &amp;quot;wb&amp;quot;);&lt;br /&gt;
  fwrite($outf, $result);&lt;br /&gt;
  fclose($outf);&lt;br /&gt;
  print &amp;quot;Job finished. Results saved to &amp;quot;.$outfile.&amp;quot;\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Perl&amp;diff=122</id>
		<title>Batch Results Retrieval in Perl</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Perl&amp;diff=122"/>
				<updated>2016-01-21T11:31:27Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;perl&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/perl&lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to retrieve the results of a batch request to TextServer &lt;br /&gt;
#&lt;br /&gt;
#  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
# the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
# import needeed libraries&lt;br /&gt;
use HTTP::Request::Common;&lt;br /&gt;
use LWP::UserAgent;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;TextServer username: &amp;quot;; &lt;br /&gt;
my $user=&amp;lt;&amp;gt;; chomp $user;&lt;br /&gt;
print &amp;quot;TextServer Job Token ID: &amp;quot;; &lt;br /&gt;
my $tkid=&amp;lt;&amp;gt;; chomp $tkid;&lt;br /&gt;
print &amp;quot;Output ZIP file: &amp;quot;;&lt;br /&gt;
my $outfname=&amp;lt;&amp;gt;; chomp $outfname;&lt;br /&gt;
&lt;br /&gt;
# URL for the requested service&lt;br /&gt;
my $TextServer_URL = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# create user agent&lt;br /&gt;
my $ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
&lt;br /&gt;
# send request to check for job termination&lt;br /&gt;
print &amp;quot;Polling server for job completion...\n&amp;quot;;&lt;br /&gt;
my $resp = $ua-&amp;gt;post($TextServer_URL.&amp;quot;/resultRetrieve&amp;quot;,&lt;br /&gt;
                  Content_Type =&amp;gt; 'form-data',&lt;br /&gt;
                  Content  =&amp;gt; [username =&amp;gt; $user, &lt;br /&gt;
                               tokenID =&amp;gt; $tkid&lt;br /&gt;
                              ] &lt;br /&gt;
                 );&lt;br /&gt;
    &lt;br /&gt;
if ($resp-&amp;gt;code==503 &amp;amp;&amp;amp; $resp-&amp;gt;decoded_content =~ /^\[TS\-125\]/ ) {&lt;br /&gt;
   # http status 503, textserver code TS-125 means the job is not finished yet.&lt;br /&gt;
   print &amp;quot;Job not finished yet\n&amp;quot;; &lt;br /&gt;
   exit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
elsif (!$resp-&amp;gt;is_success) { &lt;br /&gt;
   # some other error happened, report it.&lt;br /&gt;
    die $resp-&amp;gt;status_line.&amp;quot; - &amp;quot;.$resp-&amp;gt;decoded_content.&amp;quot;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# if status=200, we a got ZIP response, the job is done.&lt;br /&gt;
# print zipped respose to output file &lt;br /&gt;
open(my $outf, '&amp;gt;', $outfname);&lt;br /&gt;
print $outf $resp-&amp;gt;decoded_content;&lt;br /&gt;
close $outf;&lt;br /&gt;
print &amp;quot;Job finished. Results saved to &amp;quot;.$outfname.&amp;quot;\n&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Java&amp;diff=121</id>
		<title>Batch Results Retrieval in Java</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Java&amp;diff=121"/>
				<updated>2016-01-21T11:31:02Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
//&lt;br /&gt;
//  Example client to retrieve the results of a batch request to TextServer &lt;br /&gt;
//&lt;br /&gt;
//  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
// the requested format (XML, json, conll)&lt;br /&gt;
//&lt;br /&gt;
////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
import org.apache.http.client.HttpClient;&lt;br /&gt;
import org.apache.http.HttpResponse;&lt;br /&gt;
import org.apache.http.HttpStatus;&lt;br /&gt;
import org.apache.http.entity.mime.content.FileBody;&lt;br /&gt;
   &lt;br /&gt;
import org.apache.http.client.methods.HttpPost;&lt;br /&gt;
import org.apache.http.entity.mime.MultipartEntityBuilder;&lt;br /&gt;
import org.apache.http.impl.client.HttpClientBuilder;&lt;br /&gt;
import org.apache.http.util.EntityUtils;&lt;br /&gt;
&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
import java.io.FileOutputStream;&lt;br /&gt;
&lt;br /&gt;
public class RetrieveResults {&lt;br /&gt;
    &lt;br /&gt;
    // service base URL&lt;br /&gt;
    static final String textServer_URL = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
&lt;br /&gt;
        // Get request parameters&lt;br /&gt;
        System.out.print(&amp;quot;TextServer Username: &amp;quot;);&lt;br /&gt;
        String user = System.console().readLine();&lt;br /&gt;
        System.out.print(&amp;quot;TextServer Job Token ID: &amp;quot;);&lt;br /&gt;
        String tokenID = System.console().readLine();&lt;br /&gt;
        System.out.print(&amp;quot;Output ZIP file: &amp;quot;);&lt;br /&gt;
        String outfname = System.console().readLine();&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
        // prepare request to poll for completion and retrieve results&lt;br /&gt;
        request = new HttpPost(textServer_URL+&amp;quot;/resultRetrieve&amp;quot;);&lt;br /&gt;
        request.setEntity(MultipartEntityBuilder&lt;br /&gt;
                          .create()&lt;br /&gt;
                          .addTextBody(&amp;quot;username&amp;quot;, user)&lt;br /&gt;
                          .addTextBody(&amp;quot;tokenID&amp;quot;, tokenID)&lt;br /&gt;
                          .build() );&lt;br /&gt;
    &lt;br /&gt;
        System.out.println(&amp;quot;Polling server for job completion&amp;quot;);&lt;br /&gt;
        response = client.execute(request);&lt;br /&gt;
        content = EntityUtils.toString(response.getEntity());&lt;br /&gt;
            &lt;br /&gt;
        // we got an error code, lets see which one&lt;br /&gt;
        if (response.getStatusLine().getStatusCode()==HttpStatus.SC_SERVICE_UNAVAILABLE &amp;amp;&amp;amp;&lt;br /&gt;
            content.substring(0,8).equals(&amp;quot;[TS-125]&amp;quot;) ) {&lt;br /&gt;
            // SC=503 and TS_code=TS-125 mean job is not finished. keep waiting&lt;br /&gt;
            System.out.println(&amp;quot;Job not finished yet.&amp;quot;);&lt;br /&gt;
            System.exit(0);&lt;br /&gt;
        }&lt;br /&gt;
        else if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {&lt;br /&gt;
            // some unexpected error happened&lt;br /&gt;
            System.out.println(content);&lt;br /&gt;
            System.exit(1);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // No errors, we got response.&lt;br /&gt;
        // write the received ZIP result to output file&lt;br /&gt;
        InputStream sin = response.getEntity().getContent();&lt;br /&gt;
        byte data[] = new byte[sin.available()];&lt;br /&gt;
        sin.read(data);&lt;br /&gt;
&lt;br /&gt;
        FileOutputStream outf = new FileOutputStream(outfname);&lt;br /&gt;
        outf.write(data); &lt;br /&gt;
        outf.close();&lt;br /&gt;
&lt;br /&gt;
        System.out.println(&amp;quot;Job finished. Results saved to &amp;quot;+outfname);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python&amp;diff=120</id>
		<title>Batch Results Retrieval in Python</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_Python&amp;diff=120"/>
				<updated>2016-01-21T11:30:36Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/python&lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to retrieve the results of a batch request to TextServer &lt;br /&gt;
#&lt;br /&gt;
#  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
# the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
# import required libraries&lt;br /&gt;
import urllib2&lt;br /&gt;
# You may need to install &amp;quot;poster&amp;quot; python module for these two:&lt;br /&gt;
from poster.encode import multipart_encode&lt;br /&gt;
from poster.streaminghttp import register_openers&lt;br /&gt;
import xml.etree.ElementTree&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Register the streaming http handlers with urllib2&lt;br /&gt;
register_openers()&lt;br /&gt;
&lt;br /&gt;
# set query elements&lt;br /&gt;
user = raw_input('TextServer Username: ')&lt;br /&gt;
tkid = raw_input('TextServer Job Token ID: ')&lt;br /&gt;
outfname = raw_input('Output ZIP file: ')&lt;br /&gt;
&lt;br /&gt;
# service URL&lt;br /&gt;
TextServer_URL = &amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# prepare request to poll for completion and retrieve results&lt;br /&gt;
datagen, headers = multipart_encode({'username' : user,&lt;br /&gt;
                                     'tokenID' : tkid&lt;br /&gt;
                                     })&lt;br /&gt;
request = urllib2.Request(TextServer_URL + &amp;quot;/resultRetrieve&amp;quot;, &lt;br /&gt;
                          datagen, &lt;br /&gt;
                          headers)&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
  # send request to check for results&lt;br /&gt;
  print &amp;quot;Polling server for job completion...&amp;quot;&lt;br /&gt;
  resp =  urllib2.urlopen(request).read()&lt;br /&gt;
  &lt;br /&gt;
except urllib2.HTTPError, e:&lt;br /&gt;
  if (e.code == 503 and e.read()[0:8] == &amp;quot;[TS-125]&amp;quot; ) :&lt;br /&gt;
    # http status 503, textserver code TS-125 means the job is not finished yet. &lt;br /&gt;
    print &amp;quot;Job not finished yet&amp;quot; &lt;br /&gt;
  else :      &lt;br /&gt;
    # some actual error happened. abort&lt;br /&gt;
    print e, &amp;quot;-&amp;quot;, e.read()&lt;br /&gt;
  exit()&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
# no error, save results to output file&lt;br /&gt;
outf=open(outfname, 'w+')&lt;br /&gt;
print &amp;gt;&amp;gt;outf, resp&lt;br /&gt;
outf.close()&lt;br /&gt;
print &amp;quot;Job finished. Results saved to&amp;quot;,outfname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_PHP&amp;diff=119</id>
		<title>Batch Results Retrieval in PHP</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_PHP&amp;diff=119"/>
				<updated>2016-01-21T11:29:58Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /usr/bin/php5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////&lt;br /&gt;
//&lt;br /&gt;
//  Example client to submit an interactive request to TextServer &lt;br /&gt;
// SERVICENAME service. &lt;br /&gt;
//  Input may be a plain text or a text file.  No ZIP files.&lt;br /&gt;
//  Output will be in the requested format (XML, json, conll)&lt;br /&gt;
//&lt;br /&gt;
/////////////////////////////////////////////////////////////////&lt;br /&gt;
  &lt;br /&gt;
  echo 'TextServer Username: '; $user = rtrim(fgets(STDIN));&lt;br /&gt;
  echo 'TextServer Job Token ID: '; $tkid = rtrim(fgets(STDIN));&lt;br /&gt;
  echo 'Output ZIP file: '; $outfile = rtrim(fgets(STDIN));&lt;br /&gt;
&lt;br /&gt;
  // build request&lt;br /&gt;
  $TextServer_URL=&amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // prepare request to poll for completion and retrieve results&lt;br /&gt;
  $h = curl_init();&lt;br /&gt;
  curl_setopt($h, CURLOPT_URL, $TextServer_URL.&amp;quot;/resultRetrieve&amp;quot;); &lt;br /&gt;
  curl_setopt($h, CURLOPT_POST, true);&lt;br /&gt;
  curl_setopt($h, CURLOPT_POSTFIELDS, array(&lt;br /&gt;
                                       'username' =&amp;gt; $user,&lt;br /&gt;
                                       'tokenID' =&amp;gt; $tkid,&lt;br /&gt;
                                      ) );&lt;br /&gt;
  curl_setopt($h, CURLOPT_HEADER, false);&lt;br /&gt;
  curl_setopt($h, CURLOPT_RETURNTRANSFER, 1);&lt;br /&gt;
&lt;br /&gt;
  // execute request   &lt;br /&gt;
  $result = curl_exec($h);&lt;br /&gt;
  // get status&lt;br /&gt;
  $err = curl_getinfo($h, CURLINFO_HTTP_CODE);&lt;br /&gt;
  // close connection&lt;br /&gt;
  curl_close($h);&lt;br /&gt;
&lt;br /&gt;
  if ($err == 503 and strpos($result, '[TS-125]')!==FALSE) {&lt;br /&gt;
    // http status 503, textserver code TS-125 means the job is not finished yet.&lt;br /&gt;
    print &amp;quot;Job not finished yet\n&amp;quot;;&lt;br /&gt;
    exit(0);&lt;br /&gt;
  }&lt;br /&gt;
  else if ($err !== 200) {&lt;br /&gt;
    // some other unexpected error happened. Report it&lt;br /&gt;
    print &amp;quot;HTTP &amp;quot;.$err.&amp;quot; - &amp;quot;.$result.&amp;quot;\n&amp;quot;;&lt;br /&gt;
    exit(1);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // response is ok, the job is done and we got the results. &lt;br /&gt;
  // write results to output ZIP file.&lt;br /&gt;
  $outf = fopen($outfile, &amp;quot;wb&amp;quot;);&lt;br /&gt;
  fwrite($outf, $result);&lt;br /&gt;
  fclose($outf);&lt;br /&gt;
  print &amp;quot;Job finished. Results saved to &amp;quot;.$outfile.&amp;quot;\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	<entry>
		<id>http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_curl&amp;diff=118</id>
		<title>Batch Results Retrieval in curl</title>
		<link rel="alternate" type="text/html" href="http://textserver.lsi.upc.edu/wiki/index.php?title=Batch_Results_Retrieval_in_curl&amp;diff=118"/>
				<updated>2016-01-21T11:29:16Z</updated>
		
		<summary type="html">&lt;p&gt;Padro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot; &amp;gt;&lt;br /&gt;
#! /bin/sh &lt;br /&gt;
&lt;br /&gt;
########################################################################&lt;br /&gt;
#&lt;br /&gt;
#  Example client to retrieve results for a batch job previously submitted&lt;br /&gt;
#&lt;br /&gt;
#  Output will be a ZIP file containing results for each input file in&lt;br /&gt;
# the requested format (XML, json, conll)&lt;br /&gt;
#&lt;br /&gt;
########################################################################&lt;br /&gt;
&lt;br /&gt;
# Get query parameters&lt;br /&gt;
echo -n &amp;quot;TextServer username: &amp;quot;&lt;br /&gt;
read USERNAME&lt;br /&gt;
echo -n &amp;quot;TextServer Job Token ID: &amp;quot;&lt;br /&gt;
read TKID&lt;br /&gt;
echo -n &amp;quot;Output ZIP file: &amp;quot;&lt;br /&gt;
read OUTFNAME&lt;br /&gt;
&lt;br /&gt;
TEXTSERVER_URL=&amp;quot;http://frodo.lsi.upc.edu:8080/TextWS/textservlet/ws&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Polling server for job completion...&amp;quot;&lt;br /&gt;
curl -X POST -s -S \&lt;br /&gt;
    --form &amp;quot;username=$USERNAME&amp;quot;  \&lt;br /&gt;
    --form &amp;quot;tokenID=$TKID&amp;quot;  \&lt;br /&gt;
    $TEXTSERVER_URL&amp;quot;/resultRetrieve&amp;quot; &amp;gt;$OUTFNAME&lt;br /&gt;
&lt;br /&gt;
if ( grep -q '\[TS-125\]' $OUTFNAME ); then&lt;br /&gt;
  # server returned HTTP 503, with TextSErver code [TS-125], which means job not finished&lt;br /&gt;
  echo &amp;quot;Job not finished yet&amp;quot;&lt;br /&gt;
  rm $OUTFNAME&lt;br /&gt;
  exit&lt;br /&gt;
elif ( grep -q '\[TS-' $OUTFNAME ); then&lt;br /&gt;
  # some other error from TextServer &lt;br /&gt;
  cat $OUTFNAME&lt;br /&gt;
  echo &amp;quot;&amp;quot;&lt;br /&gt;
  rm $OUTFNAME&lt;br /&gt;
  exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# no error, we got the results.&lt;br /&gt;
echo &amp;quot;Job finished. Results saved to &amp;quot;$OUTFNAME&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Padro</name></author>	</entry>

	</feed>