>  >  

How to Consume a SOAP Service using REST


This page explain how to consume a SOAP service operation using a REST (to be used with Ajax in a web form for example or in a client without a SOAP library).

To consume an operation, you need to do a GET (or POST) request to the https://services.open.xerox.com/RestOp/ url.
You need to specify the Service name and after the Operation name you want to consume.
Then you need to specify all operations parmeters.

All SOAP service operations are available as a JSON format (by default) or XML format using the oxformat=xml parameter.
You can also use JSONP to avoid cross domain problem, if you want to call a service from your web site. jQuery support JSONP by specifying a callback=? parameter in the uri.


Get Sample for the Language Identifier :

GET https://services.open.xerox.com/RestOp/LanguageIdentifier/GetLanguageForString?document=This is a sample in English

Here, we call the GetLanguageForString operation of the LanguageIdentifier service.
We add the document parameter.
We receive the language in a JSON object.


POST Sample for the Language Identifier :

Like the previous sample, we use a Http POST request to call the Open Xerox web service to avoid uri request length problem.

POST https://services.open.xerox.com/RestOp/LanguageIdentifier/GetLanguageForString
Content-Type: application/x-www-form-urlencoded



jQuery Sample for the Language Identifier

{'document' : 'This is a sample in English'}, function (data) {
  var res = 'Not found';
  if (data != null) {
    res = data;