public interface Webservice
Webservice usually returns some text-based data like XML, JSON or even plain text, which can directly be
displayed/processed by the client. The implementing class needs to be defined in the application's beans.xml.
The resulting URI follows this schema:
<site-host>/service/<site-name>/<application-name>/webservice/<bean-id>?<get-params>
Example:
http://localhost:8080/service/appng/demoapplication/webservice/timeService?country=de
Usually, a link to the Webservice is provided by defining a Link in mode Linkmode.WEBSERVICE,
where the target is the bean name, optionally with some additional GET-Parameters.
<link mode="webservice" target="timeService?country=de" >
<label id="time" />
<icon>time</icon>
</link>
For providing files to download, see AttachmentWebservice.SoapService instead. RequestDataBinder for binding Request parameters to a target object.AttachmentWebservice,
RequestDataBinder,
SoapService| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Returns the content-type for the data returned by
processRequest(Site, Application, Environment, Request) (optional) |
default org.springframework.http.HttpHeaders |
getHeaders()
Returns the response headers for this service
|
default int |
getStatus()
Returns the HTTP status code for this service
|
byte[] |
processRequest(Site site,
Application application,
Environment environment,
Request request)
Processes the current
Request and return some data. |
byte[] processRequest(Site site, Application application, Environment environment, Request request) throws BusinessException
Request and return some data.site - the current Siteapplication - the current Applicationenvironment - the current Environmentrequest - the current RequestBusinessException - if an error occures during retrieving the dataString getContentType()
processRequest(Site, Application, Environment, Request) (optional)default int getStatus()
default org.springframework.http.HttpHeaders getHeaders()
Copyright © 2011–2021 aiticon GmbH. All rights reserved.