Export SwitchYard Services over SOAP/HTTP

Version 6

    Services registered in SwitchYard can be easily exposed as a Web Service over HTTP using the SOAP gateway component. The gateway leverages the JAX-WS 2.0 APIs to publish an Endpoint based on a given WSDL. SwitchYard users now have the flexibility to integrate with legacy clients via SOAP/HTTP.


    The Deployment Descriptor

    It only takes one parameter to expose the SwitchYard service over SOAP/HTTP. The bare minimum configuration would be (Component configurations not shown here):

     

    <switchyard xmlns="urn:switchyard-config:switchyard:1.0"
                xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
                xmlns:soap="urn:switchyard-component-soap:config:1.0">
        <sca:composite name="m1app">
            <sca:service name="OrderService" promote="OrderService">
                <soap:binding.soap>
                    <soap:wsdl>wsdl/OrderService.wsdl</soap:wsdl>
                </soap:binding.soap>
            </sca:service>
        </sca:composite>
    ...
    </switchyard>
    

     

    So a SwitchYard application with this enhanced deployment xml would expose the OrderService over a service URL http://localhost:8080/OrderService. The associated WSDL can be obtained from http://localhost:8080/OrderService?wsdl. This configuration above will make the SOAP gateway component to search for OrderService.wsdl in the deployment's classpath. The wsdl property can be a "file:" or a "http:" url too.

    Optional Properties

    The various additional properties that can be configured are as follows:

     

    PropertyDescriptionDefault
    serverHostThe IP address or a hostname of the NIC that this service will be exposed to.localhost
    serverPortThe network port that the service be exposed on.8080
    portThe WSDL port defintion to be used. The string can be in the form {namespaceURI}serviceName:portName", with the "{namespaceURI}" and "serviceName:" part being optional.First found port definition
    composerThe fully qualified class name of SwitchYard Message composer.org.switchyard.component.soap.DefaultMessageComposer
    decomposerThe fully qualified class name of SwitchYard Message decomposer.org.switchyard.component.soap.DefaultMessageDecomposer

     

    What are Composers and Decomposers?

    These allow you to customize how a SOAP Message is transformed into a SwitchYard Message and vise versa. The default versions of these simply copy the SOAP Body to a SwitchYard Message and the decomposer copies the SwitchYard Message into a SOAP Body. This flexibility is provided so that SwitchYard users can customize or add some proprietary SOAP headers before transmitting the SOAP Message or to read and remove them before they reach SwitchYard services.

    What containers are supported?

    We have tested it in standalone JDK 6.0 and also in JBoss AS 6 server. In AS 6, the CXF JAX-WS implementaion is used. Please let us know if you would like to see SwitchYard services being deployed in other Web Service containers too.

    What next?

    This is our future directions:

    • Other WS container integration like OSGi
    • WS-Security (SOAP Header processing, HTTP Header/Properties processing)
    • Provide an easy way to test with SOAP messages
    • Integration with JBossWS-Native, JBossWS-CXF and JBossWS-Metro

    Getting the source

    Can be obtained from SwitchYard's components git repository.