This section of the guide provides basic details on how to install the SwitchYard distribution on your system.
Two SwitchYard distributions are available pre-installed in JBoss Application Server (AS):
SwitchYard AS6: This distribution is based on the Version 6.0.0.Final of the JBoss Application Server .
SwitchYard AS7: This distribution is based on the Version 7.0.0.Beta3 of the JBoss Application Server .
Both versions of SwitchYard can be downloaded from JBoss .
SwitchYard is low on prerequisites. The only things you need check are:
You are running on a Java 6 JDK.
You have a configured instance of Maven 3 for building the SwitchYard Quickstarts.
Download the SwitchYard Distribution Zip file and simply unzip it into a suitable location on your file system.
It is not mandatory to configure $JBOSS_HOME on your system, but if you already have it configured you will need to reset it to point to the root of the unzipped SwitchYard AS6 distribution.
After unzipping the distribution you should see the following structure on your file system.
To start the SwitchYard AS instance simply open a command terminal, change directory into the distribution bin directory and execute the "run" command script (
run.sh
on Unix/Linux/MacOS and
run.bat
on Windows).
Download the SwitchYard Distribution Zip file and simply unzip it into a suitable location on your file system.
It is not mandatory to configure $JBOSS_HOME on your system, but if you already have it configured you will need to reset it to point to the root of the unzipped SwitchYard AS7 distribution.
After unzipping the distribution you should see the following structure on your file system.
To start the SwitchYard AS instance simply open a command terminal, change directory into the distribution bin directory and execute the "standalone" command script (
standalone.sh
on Unix/Linux/MacOS and
standalone.bat
on Windows).
The easiest way to get started with testing an application on SwitchYard is to take one of the distribution's Quickstart examples and run it. The AS6 and AS7 distributions both contain a quickstarts folder as follows.
The Quickstarts provided in the distribution are source only i.e. they are not pre-built. Building them is very easy. You just need to make sure you have Maven 3 configured on your system and then simply execute mvn clean install in the root of the quickstarts folder.
quickstarts$ mvn clean install
For the purpose of testing your SwitchYard distribution and simply getting something running quickly, the "Orders" demo is a good choice. After building the quickstarts, this demo Quickstart application can be found in the demos/orders/target folder. To deploy the application to a SwitchYard AS6 Server, simply copy the application jar to the server/default/deploy folder within the Server distribution. To deploy the application to a SwitchYard AS7 Server, simply copy the application jar to the standalone/deployments folder within the Server distribution.
After deploying the Orders demo application to your SwitchYard AS6/AS7 Server you should see lines similar to the following appear on the server console.
21:23:57,251 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-8) Setting the server's publish address to be http://localhost:18001/OrderService 21:23:57,265 INFO [org.switchyard.component.soap.InboundHandler] (MSC service thread 1-8) WebService published at http://localhost:18001/OrderService
This indicates that the Orders demo application has deployed successfully.
The Orders demo application demonstrates how to expose a SwitchYard Service as a Webservice using the SwitchYard SOAP Binding Gateway. As the above console output shows, this Webservice is exposed through the SOAP Endpoint http://localhost:18001/OrderService . The SOAP Gateway exposes a WSDL for all Service through the same Endpoint URL by postfixing the URL with " ?wsdl ". You can use the SOAP client of your choice (e.g. soapUI ), configured with the WSDL provided by the SOAP Gateway at http://localhost:18001/OrderService?wsdl , to invoke the Webservice endpoint using the following SOAP payload.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <orders:submitOrder xmlns:orders="urn:switchyard-quickstart-demo:orders:1.0"> <order> <orderId>PO-19838-XYZ</orderId> <itemId>BUTTER</itemId> <quantity>200</quantity> </order> </orders:submitOrder> </soap:Body> </soap:Envelope>
Assuming your SwitchYard Server instance is installed and running correctly, the Orders demo application should respond to your SOAP Client with the following SOAP response.
<?xml version="1.0"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <orders:submitOrderResponse xmlns:orders="urn:switchyard-quickstart-demo:orders:1.0"> <orderAck> <orderId>PO-19838-XYZ</orderId> <accepted>true</accepted> <status>Order Accepted</status> </orderAck> </orders:submitOrderResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
After installing SwitchYard and trying the Orders demo application, you are going to want to build your own SwitchYard applications. The easiest way to get started with this is by using the Forge Tooling. Before you can use the Forge tooling however, you need to install Forge and configure it with the SwitchYard plugins for Forge.
The first step is to install Forge itself, which is covered nicely in the Forge documentation . Make sure you setup the $FORGE_HOME environment variable.
Once Forge is installed it's time to install the SwitchYard extensions to Forge. These are located in the forge directory within the SwitchYard distribution. Simply copy these jars into the $FORGE_HOME/lib directory.
cp forge/*.jar $FORGE_HOME/lib
For more details on using the Forge tooling for SwitchYard, please see the User Guide.