Versions Compared

Key

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

OpenHub framework provides several tools and components for communication with external systems.

Components:

SOAP 1.2

OpenHub supports SOAP 1.1 and 1.2 for outgoing web service communication. There are getOutWsUri and getOutWsSoap12Uri methods framework uses Spring Web Services as library for consuming and publishing web services.

Tip

See How to implement web services? for more details about creating and publishing web service API.

Main Spring configuration is in org.openhubframework.openhub.apicore.route.AbstractBasicRoute.

There is the following configuration prerequisite (sp_ws.xml):

...

config.WebServiceConfig class that contains:

  • MessageDispatcherServlet configuration
  • logging interceptor SoapEnvelopeLoggingInterceptor
  • endpointMapping CamelEndpointMapping
  • custom adapter for recieving messages with extended error handler (ErrorCodeAwareWebServiceMessageReceiverHandlerAdapter)
  • common XSD types (commonTypes-v1.0)
  • SOAP messages factories supporting version 1.1 and 1.2
  • interceptor for validation HeaderAndPayloadValidatingInterceptor
    • each module with web service support implements WebServiceValidatingSources contract for getting XSD schemas from the module
Code Block
@Component
@Profile(ExampleProperties.EXAMPLE_PROFILE)
public class ExampleWebServiceValidatingSources implements WebServiceValidatingSources {

   <property name="soapVersion"> @Override
    public Resource[] getXsdSchemas() {
    <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_11"/>   return new Resource[] {ExampleWebServiceConfig.HELLO_OPERATIONS_XSD_RESOURCE};
  </property>  }

 </bean>   @Override
  <bean id="messageFactorySOAP12" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
   public String[] getIgnoreRequests() {
     <property name="soapVersion">  return new          <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>String[] {"{http://openhubframework.org/ws/HelloService-v1}syncHelloRequest"};
        </property>
    </bean>}
}


Spring Web services (better to say MessageDispatcherServlet) place their beans into root Spring application context.

Part of the OpenHub framework is CloseableHttpComponentsMessageSender - enhanced HTTP sender.