Working with Web Services
This article provides information on working with Web Services.
Working with a Sitefinity Web Service
As covered in the previous topic - RESTful WCF Services in Sitefinity - Sitefinity exposes WCF RESTful Services for every content type and functionality in the system. These services are very developer friendly - when they are requested in a certain way through a web browser, they will 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.
Requesting Web Service Information
In order to get 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 address of a web service:
- yourserver - the name of the server Sitefinity is hosted on. Could be localhost if you are working locally
- yourproject - the name of the project name.
- 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.
Reading 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 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:
In our next topic we will provide a list of Web Services that you can use.
- 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 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