Set Server Application Programming Server Endpoints at Runtime - Cloud - Author-it

Development Documentation

When you develop using the Apache Server Application Programming Interface you need to enable dynamically configuring endpoints at runtime. This enables you to use the same code in your development environment as you use in your production environment, regardless of whether the production environment is an on-premises installation of Author-it or Author-it Cloud. You do this by using the System.ServiceModel.ClientBase<TChannel>(String, String) constructor when you initialize instances of the clients for the Server Application Programming Server services.

Example

The sample code below shows an example of initializing an instance of a client class for the Authentication service using the SOAP endpoint and using http://aitapi.example.com/ as the base Apache Server Application Programming Interface URL.

String urlAuthentication = "http://aitapi.example.com/Authentication.svc/soap"; //Set the URL for the SOAP endpoint for the Authentication service

String endpointAuthentication = "SOAP_Authentication"; //Set the endpoint name for the SOAP endpoint for the Authentication service

Ait.Authentication.AuthenticationClient clientAuthentication = new Ait.Authentication.AuthenticationClient(endpointAuthentication, urlAuthentication); //Initialize the instance of the client for the Authentication service