xtee6adapter
xtee6adapter is a Java library for building X-Road v6 Adapter Servers. The library implements X-Road v6 SOAP profile (version 4.0.16) and Service Metadata Protocol (version 2.1.5). The library takes care of serialization and deserialization of SOAP messages: built-in support for standard X-Road SOAP headers, only processing of application request and response elements from/to SOAP Body must be implemented. Supports Multipart/Related request and response.
Documentation
The most essential classes of the library are:
ee.datel.xtee.proxy.ProxyServlet: represents X-Road producer member that produces services to X-Road.ee.datel.xtee.proxy.WsdlServlet: represents X-Road producer member that produces services description (WSDL) to X-Road.ee.datel.xtee.proxy.response.ListMethods: represents X-Road producer member that produces metadata service listMethods to X-Road.ee.datel.xtee.proxy.response.RestClient: client for service producer with REST (XML) interface.ee.datel.xtee.proxy.response.MtomClient: client for service producer with SOAP (MTOM) interface.ee.datel.xtee.proxy.server.logger.RequestLoggerFilter: logs all request/responses into file system.ee.datel.xtee.proxy.server.ServerConfiguration: reads and holds adapter configuration.
Client adds to each producer request HTTP headers:
- Xtee-ClientMemberCode - clientMemberCode from input Header.
- Xtee-UserId - userId from input Header.
- Xtee-RequestId- requestId from input Header.
- Xtee-ThreadNumber - request adapter's identificator - same used in request/responses log files name.
- SoapAction - {subsystemCode}.{serviceCode}.{serviceVersion}.only for SOAP producers.
Build configuration
In pom.xml file for each profile:
<conf.proxy.url>- this adapter access url, used in wsdl as soap:address location="<conf.proxy.url>"<application.configuration>- configuration zip file full path and filename (optional then on class path)<application.logging.pathbase>- full path for java logger and request/response files<application.logging.max-age-months>- how many months keep request/response files in <application.logging.pathbase>/requests/
Configuration ZIP file
xtee-proxy.properties
Addeded into listMethods response as xml commenet:
- metadata.profile= # configuration profile name
- metadata.version= # configuration version identficator
- metadata.date= # configuration version timestamp
Service configuration, for each service:
- proxy.{subsystemCode}.{serviceCode}.mode= # rest or mtom - service producer type
- proxy.{subsystemCode}.{serviceCode}.version= # {serviceVersion}
- proxy.{subsystemCode}.{serviceCode}.xmlns= # service namespace
- proxy.{subsystemCode}.{serviceCode}.url= # service producer URL. For REST producers adapter appends /{serviceCode}/{serviceVersion}.
- proxy.{subsystemCode}.{serviceCode}.title= # service title
Services description
- In zip file (or on class path
/configuration/) for eachsubsystemCodeown directory named as {subsystemCode}. - In the directory for each
serviceCode + serviceVersionown xsd file named as {serviceCode}.{serviceVersion}.xsd. XSD file describes service request and response elements.
Service producer
REST example
@RequestMapping(value = "/archiveTables/v1", method = RequestMethod.POST, produces = MediaType.APPLICATION_XML_VALUE, consumes = {MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE}) @ResponseBody public ArchiveTablesResponse getArchiveTables(final HttpServletRequest request) throws ManagedException { ... }
##### SOAP example
> ```
@SoapAction("etak.downloadArchiveFeature.v1")
@ResponsePayload
public DownloadArchiveFeatureResponse downloadArchiveFeature(@RequestPayload final DownloadArchiveFeature request)
throws Exception {
...
}