|
SupportQuick links |
Define Web ServiceFrom TeamWeaverWikiJump to: navigation, search
1. Define credentials2. Select method3. Define parameters4. Define result parts5. Define update policy6. Save WWSD 1. Define credentials Specify protocol:SOAPREST Enter URI: Authentication required? YesNo Username: Password: HelpChoose one of the protocols SOAP or REST, depending on the web service you like to use. Enter the URI of the web service, if you use a SOAP web service, the address (URI) has to direct to a WSDL file (e. g. http://domain.de/soap_webservice.wsdl). You can optionally define authentication credentials, currently only the basic HTTP authentication is supported. 2. Select method Select method: HelpEach web service provides different methods, which deliver different types of data. If you like to use several methods of one web service, then you have to define for each method a new WWSD. HelpChoose one of the methods HTTP-get or HTTP-postfor calling the web service. In most cases HTTP-get is appropriate.3. Define parameters
HelpEach parameter is identified by a path, which addresses it in the parameter type hierarchy and an alias, which displaces the path of the parameter. Alias are necessary to use parameters later in an easy way. Browse the parameters by expanding and collapsing the type hierarchy in the tree view. Web services with a plain hierarchy don’t have a tree view. In some cases it is not necessary to pass a value for each parameter when calling a web service. If you do not need a parameter, leave it empty or mark it as optional. Activate the ‘Use’-Checkboxes, to include the parameters into the WWSD. Thus users are later able to provide values for parameters when calling the web service. You can use the “Auto generate alias” function to generate an alias based on the selected parameter.If a parameter is not required for the web service, you can mark this parameter as optional. Mark a parameter as optional, if users call the web service without passing a value for this parameter. Otherwise users will get an error message. Define a default value for a parameter, this value will be used if a parameter is not optional and if no value for that parameter was passed to the web service call. Define subparameters if necessary, e. g. to make using complex parameters easier to use. HelpClick on the Add parameters-button and the table for defining parameters will be displayed. Enter the path of the parameter. If you do not enter a path for a parameter, then this parameter will not be included into the WWSD. Enter an alias for the parameter, otherwise the parameter path will be used as alias. If a parameter is not required for the web service, you can mark this parameter as optional. Mark a parameter as optional, if users call the web service without passing a value for this parameter. Otherwise users will get an error message. Define a default value for a parameter, this value will be used if a parameter is not optional and if no value for that parameter was passed to the web service call. 4. Choose result parts
HelpDefine the result parts to display in Wiki articles. Activate the ‘Use’-Checkboxes, if users later should be able to use the selected result part it in a Wiki article. Each result part is identified by a path, which addresses it in the result type hierarchy and an alias, which displaces the path of the parameter. If the result parts contain information encoded in XML or JSON, add subpaths to extract the relevant information. Subpaths can have the JSON or XPath format. (Currently only the XPath format is supported.) Enter the path to the information you like to extract. Add an alias to each subpath. Manually defined result parts will be displayed below a grey line in editing mode. HelpRESTful web services return a string as their result. This string can be a simple text or it can contain information encoded in a format like JSON or XML. If you like to import the complete result of the web service, activate the “Use complete result as result part”-checkbox. If you like to define further result parts, click on the Add result parts-button, so that the table for defining them will be displayed. Define in the table which further parts of this result users should be able to display in Wiki articles. Enter an alias for each result part. This alias will later be used to address the result part when the web service is used in an article. If you do not specify an alias, then a random one will be created. Choose the JSON or the XPath format depending on the path you like to use for extracting result parts. Enter the path which will be used to extract the result part from the complete result. 5. Define update policy
HelpThe update policies define the time period for updating the results delivered by a web service. Choose the display policy for displaying results in an article. E. g. if the display policy is set to a max age of 2 days the results of the web service call will be display the cached web service results for 2 days. After that period the web service will be called again and the cached results will be replaced with the new ones. Otherwise the web service will be called again and the cached result will be replaced. The display policy once means that the web service result will never be updated. Choose the query policy for semantic queries, this updates the gardening bots in your Wiki. The delay value (in seconds) is applied between two subsequent calls of a web service. So you can prevent, calling a web service too often in a short time, which may violate the terms of use of the web service provider. The span of life defines how long a result of a web service call will be kept in the cache. Providing no value, web service results will be kept in the cache for an unlimited time span. Depending on defined span of life, you can appoint the expiry of the cached results. If the cached results should expire after their last update, choose ‘No’. If they should expire after their last access (e. g. by viewing an article), choose ‘Yes’. 6. Save WWSD Enter name:HelpEnter name of the web service. Your web service "" has been successfully created. Now you can use that web service in an article. You can do that manually by using the #ws parser function or via the GUI for using a web service. This GUI is available via the semantic toolbar. Your web service will from now on be available in the list of available WebServices. You can now go on and define another WWSD. ErrorIt was not possible to connect to the specified URI. Please change the URI or try again. It was not possible to connect to the specified URI. Please change the URI or try again. The parameter definition of this method contains a recursive definition. Please choose another Web Service or another method It was not possible to connect to the specified URI. Please change the URI or try again. todo: write error message todo: write error message You have to specify a name for the WWSD before it is possible to proceed. An article with the given name allready exists. Please choose another name and try again. An error occurred when saving the WWSD. Please try again!
Retrieved from "http://teamweaver.org/wiki/index.php?title=Special:DefineWebService"
|