View Source

Welcome to 2nd day starting guide\! Today you will learn to deploy and administrate services in Petals ESB.

{panel:title=Last tested with}
* Petals Guide Package 1.0 - [Download binaries here|http://download.petalslink.com/petals-esb-all.html]
* Tomcat 6.0.29
* JDK 6 update 20

This Tutorial uses:
* Petals Studio
* Petals ESB _(new)_
* Petals SE RMI _(new)_
* Petals BC SOAP _(new)_
* Petals Web console _(new)_
* Tomcat _(new)_

{panel}

Any question, any problem? Find the solution on the [WSDL and Administration discussion|http://forum.petalslink.com/Petals-Starting-Guide-day-1-amp-2-WSDL-amp-Administration-td2688072.html].


h2. Installation

*Downloads*

# [Download a JDK 6|http://www.oracle.com/technetwork/java/javase/downloads/index.html]
# [Download Apache TomCat|http://tomcat.apache.org/download-60]
# [Download Petals binaries|http://doc.petalslink.com/x/t4KK] : Petals ESB, Petals Webconsole, Petals-SE-RMI  & Petals-BC-SOAP.

*Install required software*
# Install the JDK, if it is not already installed. Configure JAVA_HOME environment variable (Get help for [Windows|http://confluence.atlassian.com/display/CONF25/Set+JAVA_HOME+variable+in+Windows] or for [Linux|http://trentrichardson.com/2010/02/10/how-to-set-java_home-in-ubuntu/])
# Install Tomcat (see [Tomcat documentation|http://tomcat.apache.org/tomcat-6.0-doc/index.html]).

*Install Petals ESB*
# Install Petals ESB: Unzip the package.
Under windows, put the petals folder at a disk root _C:/petals-platform-xxx_ (otherwise, you may encounter well-known issues with too long file paths).

*Install the Petals Web console*
# Copy _petals-webconsole-ui-xxx.war_ into _apache-tomcat-xxx/webapps_
# Start Tomcat to deploy.

h2. Get Petals ESB running

*Start Petals ESB (command line for the first time):*
# Open a terminal (under Windows, open the *Start* menu, select *Execute* and type in _cmd_).
# Go to directory _./petals-platform-xxx/bin/_
# Execute _startup.bat \-C_ (Windows) or _startup.sh \-C_ (Linux)
{info} "-C" option activates Petals ESB command line. This is for pedagogic reasons. Don't use this options next time, unless you love command line.
{info}
# Once Petals started, type: _help_. Try whatever command you want. Nothing is deployed yet.

*Install BC-SOAP with Autoloader:*
# Copy-Paste _petals-bc-soap-xxx.zip_ in _./petals-platform-xxx/install/_
# Go back to Petals ESB terminal, and check from traces that the SOAP BC was successfully started.
# Type "_c_". You should see BC-SOAP is deployed.
{info}There are several ways to install Components and Service Assemblies:
* Drop the zip in _./petals-platform-xxx/install/_ ; The component is already started. (To uninstall, remove the _.zip_ file from _./petals-platform-xxx/installed/_ )
* Install from Webconsole. We will see it at next step.
* Install from command line. Mostly for scripts, or if you prefer command-line.
* Install via JMX (with the JConsole) or with ANT tasks.{info}

h2. Get into the Webconsole

Yesterday you generated .zip packages with Petals Studio. Let's deploy them in Petals ESB, with the Webconsole...

*Start Petals Webconsole:*
# Start Tomcat (if not already started)
# In your web browser, go to: _[http://localhost:8080/petals-webconsole-ui-x.x.x/|http://localhost:8080/petals-webconsole-ui-x.x.x/]_ ("x" representing version digits of _petals-webconsole_ ; Check the _/webapps/_ folder in Tomcat directory if you are not sure)
Welcome to the Petals administration console\! From here you will deploy, test and monitor components and services.

*Install Services-Assemblies with Webconsole:*

# Click *Server: 0* , on the left. {info}There is just one server for now. One of Petals unique feature is to support multiple servers all connected at the same time.{info}
# Go to: *Administration > Service-Assemblies*.
# Install the five .ZIP Service-Assemblies your generated with Petals Studio.
# Start all Service-Assemblies.
{info}Those operation change components state :
* Start: Component is running.
* Stop: Component stops receiving messages.
* Shutdown: Clean-up and release all ressources used by components.
* Uninstall: Removes the component.
* Force undeploy: Stop, Shutdown and Undeploy. If one operation has an error, it is ignored and go to next step. This should be used only in case of service crash, or if you really need to fast undeploy.
{info}

*Test Service-Units with Webconsole:*
# Install _Petals-SE-RMI_ in Petals ESB.
# Click *Manage connections* on the top of Webconsole page.
# Click on your server (should be *localhost*)
# Check *petals-se-rmi component enabled* and click *Submit*.
# Click *Refresh Domain* on the left panel, to take endpoints into account.
# Go to *Test* Panel in the Webconsole. You have an interface with:
#* Endpoint: The endpoint to reach in Petals ESB.
#* Interface: The interface name implemented by the service of the endpoint
#* Service: The service exposed by the endpoint
#* Operation: The list of accessible operation for the given service
#* Content: Message content. A sample message is generated automatically when a WSDL is provided.
#* MEP: Different message exchange patterns. InOnly and InOut are the most common as they are the MEP supported in WSDL 1.1.
#* Timeout: Timeout of the invocation, as the Web console use synchronous invocations.
#* Send a DONE: Acknowledgment to send back for a potential response, to match according to the MEP in use.
# You can try to send a test message. You will get a timeout error since services are abstract, without implementation. Be patient, we will use real services tomorrow.
# Type "q" or "stop" in Petals ESB command line, once you have finished, to stop it. (Or just press Ctrl+C without command line)

\\
*DONE. Bravo \!*
Now you know how to:
* Set-up your Petals working environment.
* Deploy components and Service-Assemblies in Petals ESB.
* Administer services in Webconsole, and send them messages via the bus.

\\
*Tomorrow you will connect a FTP server using BC-FTP, and proxify FTP operations over SOAP.*