EFT Web Service

In EFT Enterprise edition, the Web Service allows you to initiate EFT workflow from an external application such as an enterprise scheduler. The WebService interface follows the model of ASP.NET Web services, providing a page for the services definition document (WSDL) and an HTML form that can be used to test available service methods. Access to Web Service requires authentication with a COM-enabled Server Administrator account; without proper authentication and COM privileges, EFT returns a 401 Unauthorized HTTP error to the requestor.

The Web Service requires an SSL certificate, because EFT sends the HTTP Web Service requests via HTTPS. EFT allows you to turn on Web Service without selecting the HTTPS check box, but it checks for an SSL certificate, because it will automatically redirect HTTP to HTTPS. Even when the HTTPS check box is not selected, Web Service requests are handled by the HTTPS engine (port 443 listener, by default), but other HTTPS requests will still get the 503 Service unavailable response.

The Web Service is enabled in the Site's Listener Settings area. Refer to Enabling Web Services for the procedure for enabling the Web Service on the Site.

Requests to any /WebService URL are logged to the text log and ARM database just as any other HTTP request. A request that does not match the /WebService/InvokeEventRule URL or that does not include the required parameters, results in a 400 Bad Request HTTP error.

The /WebService page displays a list of Web services available with EFT. This page is generated from an HTML page in EFT installation folder, in a subfolder called WebService.

By default, the following files are installed in:

C:\Program Files\Globalscape\EFT\web\public\EFTClient\WebService

EFT uses a template for the WSDL to construct the final WSDL. External tools can use the WSDL by pointing to the URL that deploys the WSDL file at

http://localhost/WebService/InvokeEventRule?wsdl, where "localhost" is the IP address, computer name, or DNS name that points to the EFT service that is hosting the web service.

How EFT Supports Web Service

EFT supports both POST and GET HTTP requests to "/WebService/InvokeEventRule" with two parameters "EventRuleName" and "EventParams" and triggers an Event Rule that is specified in the "EventName" as a synchronous operation. The Web Service supports the REST invocation model, supporting both POST and GET methods for invocation.

  1. If an input is missing any of "EventRuleName" or "EventParams" it returns an HTTP 400 error.

  2. If both "EventRuleName" and "EventParams" are presented but:

    1. "EventRuleName" is wrong (no Event Rule exists with such name), it returns .xml with result code of -1.

    2. "EventParams" are incorrect (wrong variable names, too many, too few), EFT looks for Rule variables in the input and replaces those values with found ones. All additional variables are ignored. If a Rule variable is not found in URL then it will be set to "N/A." The result code in .xml will be the Event execution result code.

Requests to any /WebService URL is logged to the text log and ARM system just as any other HTTP request.

HTTP GET

The following is a sample HTTP GET request and response. Replace the placeholders with actual values.

GET /WebService/InvokeEventRule?EventRuleName=string&EventParams=string HTTP/1.1 Host: localhost

HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <int xmlns="http://mydomain/ ">int</int>

HTTP POST

The following is a sample HTTP POST request and response. Replace the placeholders with actual values.

POST /WebService/InvokeEventRule HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: length EventRuleName=string&EventParams=string

HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <int xmlns="http://mudomain/ ">int</int>

Web Service Timeout

The Web Service timeout is set to 60 seconds. You can change the timeout value with the following registry setting:

[HKEY_LOCAL_MACHINE\SOFTWARE\Globalscape Inc.\EFT 4.0]

"WebServiceTimeout"=dword:<value, in seconds>

If this value is absent, the default is 60 seconds. This value is checked for each Web Service connection, so the EFT service does not need to be restarted for this setting to take effect.

Executing Event Rules Using Web Service

In EFT Enterprise edition, the Web Service allows you to initiate EFT Event Rules via a browser.

For more information about how EFT supports Web Service, refer to EFT Web Service.

The administrator account must have the COM administration privilege for access to any /WebService URL (or sub-URLs).

To execute an Event Rule using WebService

  1. Open a browser and navigate to EFT URL appended with /WebService. The WebService page appears.

  2. Click InvokeEventRule. Another Web page, /WebService/InvokeEventRule, displays a form for invoking an Event Rule.

  3. In the EventRuleName box, type the name of the Event Rule.

  4. In the EventParams box, type one or more variables, separated by semicolons.

  5. Click Invoke. The Event Rule is executed.

    All WebService responses use the Site's domain name as the namespace for the WebService.

    After the Event Rule finishes dispatching, the Web service responds with an XML document that consists of a single "Result" element. The Result Code can be any one of the following:

Related Topics