Example Deployer
================

This sample provides an example deployer that accepts a zip containing a WSDL definition, and then makes a
web service available using that interface. The operations performed on that WSDL interface are implemented
using an Example Service Provider that simply displays a message on the console, and returns a fault response.

Build the Example
-----------------

The only task is to build the war ready for deployment.

From the $DSP/samples/example-deployer folder, run the following command:

	ant build -Dplatform=<platform>

(current platforms supported are: jbossas5, jbossas6 and tomcat)

If built successfully, this will create a war file in the build folder.



Deploying the example to JBoss Application Server
-------------------------------------------------

1) Start the JBoss Application Server (default profile assumed)

2) Install the Example Service Provider's Deployer Web App

Copy the $DSP/samples/example-deployer/build/dsp-example-deployer.war into $JBOSSAS/server/default/deploy


Deploying the example to Apache Tomcat
--------------------------------------

1) Install the example service provider

Copy the dsp-example-provider.jar into $CATALINA_HOME/lib

2) Start the Apache Tomcat server

NOTE: Make sure that the CATALINA_HOME environment variable is set correctly before starting the server.

3) Install the Example Service Provider's Deployer Web App

Copy the dsp-example-deployer.war into $CATALINA_HOME/webapps



Running the Example
-------------------

1) Deploy an Example WSDL

Start a browser and enter the following URL: http://localhost:8080/dsp-example-deployer/

When the 'Dynamic Service Provider Example' page is displayed, requesting the web service details, browse to the
hello_world.zip contained in the samples folder. This zip contains a WSDL definition that will be used to provide
the web service implemented using the example dynamic service provider implementation.

2) Send a message to the web service

Using a suitable SOAP client, such as SOAPUI, send the following message to:
http://127.0.0.1:8080/Quickstart_bpel_hello_worldWS/

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:hello>
         <TestPart>Hello World</TestPart>
      </wsdl:hello>
   </soapenv:Body>
</soapenv:Envelope>

You should receive the following response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode xmlns:ns0="http://www.example.org">ns0:ExampleFault</faultcode>
         <faultstring>Fault string, and possibly fault code, not set</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

NOTE: The response may vary slightly depending upon the platform used. The important part of the
response is the fault code, which should represent an 'ExampleFault' in the 'http://www.example.org'
namespace.


3) Undeploy the service

Select the service in the undeploy section of the deployer's web page. This will remove the web service
associated with the Hello World web service.
