![]() |
JAXM SOAPRP Sample Application |
JAXM SOAP Remote Provider (SOAPRP) Sample Application
This document describes how to utilize the JAXM SOAPRP sample application in conjunction with the Sun Java (tm) System Application Server 7.This sample application document contains the following sections:
- Overview
- Compiling and Assembling the Application
- Deploying the Sample Application
- Running the Sample Application
- Troubleshooting
Overview
The purpose of this document is to demonstrate the support for the Java API for XML Messaging in the Sun Java (tm) System application server.
The Java API for XML Messaging
The Java™ API for XML Messaging (JAXM) Optional Package enables applications to send and receive document oriented XML messages using a pure Java API. JAXM implements Simple Object Access Protocol (SOAP) 1.1 with Attachments messaging so that developers can focus on building, sending, receiving, and decomposing messages for their applications instead of programming low level XML communications routines.This sample application is an example of a round trip message that uses a JAXM messaging provider that supports the basic SOAP-RP profile to send and receive a message.
IMPORTANT: This sample application requires a messaging provider in order to run successfully. The JAXM Messaging Provider Sample application is required to be deployed prior to deploying the JAXM SOAPRP sample application. To deploy the messaging provider, see Messaging Provider Sample Application before proceeding further. It must be emphasized that the Messaging Provider Sample application is provided for sample purposes only. It is not production quality and not supported in any way. The Messaging Provider was originally part of the Java Web Services Developer Pack and provided here as a convenience.
For more information on messaging providers, go to http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXM2.html#63991.For more information on JAXM, go to http://java.sun.com/xml/jaxm/index.html.
<install_root>/samples/webservices/jaxm/soaprp/src/ .
Compiling and Assembling the Application
This section describes how to compile and assemble the application using a Command Line Interface.See the Sample Application Build Facility document for details on using a build facility.
NOTE: This sample uses the default host and port configuration parameter values of localhost and port 1024 respectively. If your Sun Java (tm) System application server has a different host and/or port configuration, please make the appropriate modifications to the address.properties and client.xml files located under <install_root>/samples/webservices/jaxm/soaprp/src before beginning compilation.
To rebuild the entire application from scratch, perform the following steps:
- Compile and assemble the application.
- Create Javadocs for the application.
- Execute the asant javadocs command under <install_root>/samples/webservices/jaxm/soaprp/src/ to create javadocs.
- The Javadocs are created under <install_root>/samples/webservices/jaxm/soaprp/javadocs.
- Clean the web application project area (optional).
Deploying the Sample Application
To deploy the application, do the following:Execute the command asant deploy under <install_root>/samples/webservices/jaxm/soaprp/src
This will deploy the jaxm-soaprp.war file located under <install_root>/samples/webservices/jaxm/soaprp/
Note You must run asant undeploy before redeploying this sample. This will ensure that all modules are undeployed and the resources are disabled.
Verifying Deployment
As an optional step, you can use the Sun Java (tm) System Application Server Administration Tool to verify that the application has been registered. Otherwise, proceed directly to Running the Sample Application.To verify the registration of the application, do the following:
Execute the command asadmin list-components to look at applications deployed with a server instance. For example:
<install_root>/bin/asadmin list-components -u <username> -w <password> -H <host> -p <port> <server instance name>
You will see jaxm-soaprp listed.
Running the Sample Application
You can run the application through the following URL:http://<hostname>:<port>/jaxm-soaprp
The file created by the sample, sent.msg is located under <install_root>/domains/domain1/<server-instance>/config/
- Note that the sample application expects the JAXM message provider running in the http://localhost:1024 port. If your server is not running in the 1024 port, either change the http listener port to 1024 or do the following changes to the sample.
Go to the /opt/SUNWappserver7/samples/webservices/jaxm/soaprp/src location and modify the client.xml and address.properties files as described below.
The client.xml should have entries like this
In the above, you should change 1024 to the port in which your HTTP listener is listening. http://java.sun.com/xml/jaxm/provider
http://localhost:1024/jaxm-provider/sender
In the address.properties file change the "to" address to reflect the port in which HTTP listener is listening.
to=http://localhost:1024/jaxm-provider/digest
- If you encounter problems when running the application, review the log files at <install-root>/domains/domain1/<server-instance>/logs/server.log to learn what exactly went wrong.
- In some cases, the server.log file will show a java.security.AccessControlException or java.io.FilePermission related to the sample JAXM Messaging Provider. This is due to the sample quality of the messaging provider and is inconsequential to the JAXM SOAPRP Sample.
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated July 12, 2002