For developers: Work with web services
Sitefinity CMS exposes WCF RESTful Services for every content type and functionality in the system. Once you request the services in a browser in a specific way, they provide detailed description of every method they expose, together with request format and an example.
Therefore, we will describe how a web service can be called so it can display the needed help information, together with the list of services and information on what they should be used for.
Request Web Service Information
To get a list of all methods that a service exposes, use a web browser that supports XML response, such as IE or Firefox, and open the following web service address:
http://yourserver/sitefinity/Services/<ServiceDirectory>/<ServiceName>.svc/help
- yourserver - the name of the server Sitefinity CMS is hosted on. Could be localhost if you are working locally.
- ServiceDirectory - the different services are placed in different directories. For example, the content related services are in the Content directory.
- ServiceName - the name of the service name.
IMPORTANT: In your web.config file, in the <endpointBehaviors> section, you need to add <webHttp helpEnabled="true"/> in the <behaviors> section.
Read the Web Service information
Let's consider that you have requested a web service with the /help in the end. Here is what you should see:
NOTE: Note that the request ends up with /help - if you do not place it there, you will not receive any web service information. You have to be authenticated to see this information though.
For the purpose of the example, we have requested the FlatTaxon service.There is a table with help information for every web method that this service exposes. In our case, we will see how to read the help information for the GetTaxa method:
- UriTemplate - a request template that you can use to construct your web service request
- Method - The HTTP verb (GET/POST/DELETE/PUT) that you should use for this request. Since Sitefinity CMS services are RESTful based, different verbs can be used depending on the method operation (creating/deleting/getting/editing).
- Response Format - The format in which the response comes.
- Response Schema - Provides information the schema used for the response.
- Response Example - Shows an example response that will be returned by calling this webmethod
- Description - Shows the method description