= jaxws-ejb: An EJB JAX-WS Web Service
:author: R Searls
:productName: WildFly
:productNameFull: WildFly Application Server
:jbossHomeName: WILDFLY_HOME
:productVersion: 12
:buildRequirements: Java 8.0 (Java SDK 1.8) or later and Maven 3.3.1 or later
include::../shared-doc/attributes.adoc[]

:level: Beginner
:technologies: JAX-WS
:source: {githubRepoUrl}

[abstract]
The `jaxws-ejb` quickstart is a working example of the web service endpoint created from an EJB.

:standalone-server-type: default
:archiveType: war
// Override the archive directory
:archiveDir: {artifactId}/service/target
// Override the archive name
:archiveName: {artifactId}-service

== What is it?

The `jaxws-ejb` quickstart demonstrates the use of _JAX-WS_ in {productNameFull} as a simple EJB web service application.

//*************************************************
// Add System Requirements
//*************************************************
// == System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]

//*************************************************
// Add Use of JBoss Home Name
//*************************************************
// == Use of {jbossHomeName}
include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]

//*************************************************
// Start the server with the default profile
//*************************************************
// == Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]

//*************************************************
// Install the quickstart parent artifact
//*************************************************
// == Install the Quickstart Parent Artifact in Maven
include::../shared-doc/install-quickstart-parent-artifact.adoc[leveloffset=+1]

//*************************************************
// Build and deploy the quickstart WAR
//*************************************************
// == Build and Deploy the Quickstart
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+1]

== Access the Application

You can check that the Web Service is running and deployed correctly by accessing the following URL: http://localhost:8080/{artifactId}/EJB3Bean?wsdl. This URL will display the deployed WSDL endpoint for the Web Service.

== Run the Client

. Make sure you xref:install_the_quickstart_parent_artifact_in_maven[Install the Quickstart Parent Artifact in Maven].

. Verify that the service is deployed properly.

. Open a terminal and navigate into the client directory of this quickstart.
+
[source,options="nowrap"]
----
$ cd client/
----

. Type this command to run the client.
+
[source,options="nowrap"]
----
$ mvn exec:java
----

. You should see the following output in the client console.
+
[source,options="nowrap"]
----
EJB3Bean returning: ejbClient calling
----

//*************************************************
// Undeploy the quickstart archive
//*************************************************
// == Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]


//*************************************************
// Add JBoss Developer Studio instructions
//*************************************************
// == Run the Quickstart in Red Hat JBoss Developer Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]

// Additional JBoss Developer Studio instructions
For this quickstart, follow the special instructions to link:{useEclipseDeployJavaClientDocUrl}[Deploy and Undeploy a Quickstart Containing Server and Java Client Projects]

. To build all of the artifacts, right-click on the *{artifactId}* parent project, and choose *Run As* –> *Maven install*.
. To deploy the service:
** Right-click on the *{artifactId}-service* subproject, and choose *Run As* –> *Run on Server*.
** Choose the server and click *Finish*.
** This starts the server and deploys the service to the server.
. To access the application:
** Right-click on the *{artifactId}-client* subproject and choose *Run As* –> *Java Application*.
** You should see the following message in the *Console* tab:
+
[source,options="nowrap"]
----
EJB3Bean returning: ejbClient calling
----

. To undeploy the project, right-click on the *{artifactId}* parent project and choose *Run As* –> *Maven build*. Enter `wildfly:undeploy` for the *Goals* and click *Run*.

//*************************************************
// Add info to debug the application
//*************************************************
// == Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]

// Additional debug info
[NOTE]
====
You will see the following informational messages. This is because the source files for these JARs are not available in the Maven repository. The `jaxws-ejb-service` source files are available in the `jaxws-ejb` project.

[source,options="nowrap"]
----
[INFO] The following files have NOT been resolved:
[INFO]    xerces:xercesImpl:jar:sources:2.9.1:compile
[INFO]    com.wutka:dtdparser:jar:sources:1.21:compile
[INFO]    org.jboss.quickstarts.eap:jaxws-ejb-service:jar:sources:7.0.0.GA:compile
----
====
