Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • WSDL and XSD is defined in Contract-First design approach - firstly define web service interfaces, secondly implement them in specific language.
  • there are two files (in package resources/org.openhubframework.openhub.modules.in.hello.ws.v1_0): WSDL definition (e.g. hello-v1.0.wsdl) and XSD with requests/responses definition (helloOperations-v1.0.xsd). XSD contains request definitions, imports commonTypes-v1.0.xsd with common types
  • publish WSDL/XSD files - add configuration to /META-INF/sp_ws_wsdl.xml. sws:static-wsdl is used for publishing WSDL, XSD files have to be published separately. See Spring Web Services reference manual where you find more information because Spring WS is underlying library for web service communication.
  • register XSD schemas for validation incoming/outgoing messages in configuration of "validatingInterceptor" (class HeaderAndPayloadValidatingInterceptor)
    • traceHeader is mandatory for asynchronous requests only - set synchronnous requests in ignoreRequests property to ignore this validation
  • configure conversion to Java classes - use jaxws-maven-plugin Maven plugin for conversion from WSDL or jaxb2-maven-plugin for conversion from XSD

Synchronous Hello service

Synchronous implementation is in class orgclass org.openhubframework.openhub.modules.in.hello.SyncHelloRoute.

If comes web service request with element name syncHelloRequest and namespace http://openhubframework.org/ws/HelloService-v1) then this route is "activated" and request starts processing. Response is immediately send back to the source system.

...

Asynchronous implementation is in class org.openhubframework.openhub.modules.in.hello.AsyncHelloRoute.

If comes web service request with element name asyncHelloRequest and namespace http://openhubframework.org/ws/HelloService-v1) then this route is "activated" and request starts processing. Firstly synchronous part is proceeded - input request is validated and saved into queue (database) and synchronous response is immediately send back to the source system with information that OpenHub accepted input request and ensures request processing. When request processing finishes then asynchronous confirmation with processing result is send to source system.

Unit tests implementation

There are corresponding unit tests to each route -  SyncHelloRouteTest resp resp.   AsyncHelloRouteTest.