JBoss.orgCommunity Documentation
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>