| Java TM Web Services WS-I Supply Chain Management Sample Application 1.0 |
WS-I Supply Chain Management Sample Application 1.0
This document describes Java TM WS-I Supply Chain Management Sample Application 1.0 as deployed in the Sun Java System Application Server Platform Edition 8.This document contains the following sections:
1.0 Introduction
2.0 Directory Structure
3.0 Pre-Requisites
4.0 Invoking the service
5.0 Building from the source
6.0 Configuring Logging
7.0 Troubleshooting
8.0 References
1.0 Introduction
This document explains the Sun's early access implementation of WS-I Sample Supply Chain Management Application.The Web Services Interoperability (WS-I) Organization [1] is an organization committed to promoting interoperability among Web Services based on common, industry accepted definitions and related XML standards support. Towards this end, the WS-I organization is producing a set of deliverables that is intended to assist developers in creating and deploying interoperable Web Services. WS-I Sample Application, one of the deliverables from WS-I, demonstrates the reality of practical application of Web Services technologies to solve real business needs.
WS-I Sample Application is defined as a sample Supply Chain Management application. The use case design of this sample application is defined in Supply Chain Management Use Case Model [2]. Technical design and implementation details of this sample application are documented in Supply Chain Management Architecture document [3].
![]()
The application being modeled is that of a Retailer offering consumer electronic goods to Consumers; a typical B2C model. To fulfill orders, the Retailer has to manage stock levels in Warehouses. When an item in stock falls below a certain threshold, the Retailer must restock the item from the relevant Manufacturer's inventory; a typical B2B model. In order to fulfill a Retailer's request, a Manufacturer may have to execute a production run to build the finished goods. In the real world, a Manufacturer would have to order the component parts from its suppliers. For simplicity in this application, it is assumed this is a manual process which is supported through the use of fax. Each use case includes a logging call to a logging facility in order to monitor the activities of the services.
Optionally, there is a Configurator Web Service that lists all of the implementations registered in the UDDI registry for each of the Web Services in the sample application.
There is 1 Retailer, 1 Logging Facility, 3 Warehouses, 3 Manufacturers and 1 Configurator, and thus a total of 9 Web Services.
This document explains the Sun's implementation of WS-I Sample Supply Chain Management Application.
2.0 Directory Structure
This section explains the directory structure
docs
HTML Documentation
config
Configuration files required by JAX-RPC tools
config/scm/wsdl
WSDL descriptions for the Web Services
src
Source files
wsi.war
WAR file with all the Web Service endpoints
logs
SOAP request and response message files and generated results
3.0 Pre-Requisites
Before any of the sample app Web Service can be invoked, you need to ensure
- The application server is running (see How to start server )
- The Pointbase database server accompanying the application Server is running at port 9092 (see How to start Database)
- The unpackWARs attribute of the webserver where the application is deployed is set to "true". The Sun Java System Application Server Platform Edition 8 sets this to true by default. NOTE: This is a container wide setting and will impact other applications deployed in this application server as well. Enabling this setting explodes the content of the war file in the directory where the application server store its web applications.
- A user with the username "PBPUBLIC" and password "PBPUBLIC" exists in the database with rights to create tables and insert data. This is the default user in pointbase database as of now but may change in future versions.
- If inside a firewall, make sure to setup the http proxy host name and port number on the application server. This can be done by setting the http.proxyHost and http.proxyPort properties in config/build.properties, and then typing asant set-proxy-host in the src directory, or manually, by adding the following two entries inside the <java-config> element of the INSTALL_ROOT/domains/<domain_name>/config/domain.xml file (<domain_name> is the domain where the application will be deployed; usually domain1):
<jvm-options>-Dhttp.proxyHost=webcache.sfbay.sun.com</jvm-options>
<jvm-options>-Dhttp.proxyPort=8080</jvm-options>Once the database is running, you need to create a database with the URL "jdbc:pointbase:server://localhost:9092/wsi" by invoking the INSTALL_ROOT/pointbase/tool/serveroptions/startconsole.[sh|bat] script of the pointbase server bundled with the application server.
4.0 Invoking the service
Make sure the application server is up and running before invoking any of the services.
4.1 Invoking the Retailer client
Retailer client acts as a consumer of the electronics good and places pre-defined orders (defined in config/order-config.xml) to the Retailer Web Service. Retailer Web Service then invokes the warehouse and manufacturer Web Service to fulfill the supply chain model defined in section 1.0 above. The orders are defined such that the various combinations of retailer, warehouse and manufacturer are being invoked. The set of endpoints is defined in config/endpoints.props and the combination of endpoints is defined in config/vendor-config.xml.
- Make sure config/endpoints.props has the correct host and port information.
- Switch to the src directory of the wsi application
- Deploy the application by typing: asant deploy
- If inside a firewall, make sure to setup the http proxy host name and port number on the application server. This can be done by setting the http.proxyHost and http.proxyPort properties in config/build.properties, and then typing asant set-proxy-host in the src directory; or manually, by adding the following two entries inside the <java-config> element of the INSTALL_ROOT/domains/<domain_name>/config/domain.xml file:
<jvm-options>-Dhttp.proxyHost=webcache.sfbay.sun.com</jvm-options>
<jvm-options>-Dhttp.proxyPort=8080</jvm-options>
- Type
asant run-retailerto invoke the client. This will invoke the getCatalog function from the RetailerService and places the various pre-defined orders to the Retailer Web Service.4.2 Invoking the Configurator client
The Configurator client queries a public UDDI Business Registry for the WS-I sample application endpoints implemented by all the vendors which have a peer-to-peer relationship with WS-I business entity and displays them.
- Switch to the src directory of the wsi application
- Deploy the application by typing: asant deploy
- If inside a firewall, make sure to setup the http proxy host name and port number on the application server. This can be done by setting the http.proxyHost and http.proxyPort properties in config/build.properties, and then typing asant set-proxy-host in the src directory; or manually, by adding the following two entries inside the <java-config> element of the INSTALL_ROOT/domains/<domain_name>/config/domain.xml file:
<jvm-options>-Dhttp.proxyHost=webcache.sfbay.sun.com</jvm-options>
<jvm-options>-Dhttp.proxyPort=8080</jvm-options>This is required to be able to talk to UDDI Business Registry outside the firewall.- The Configurator Web Service performs tasks that require the modification of the default security policy of the server. Please make sure to add the following grant clauses to the domains/<domain_name>/config/server.policy file and restart the server, before you invoke this web service:
// Permissions for JAXR
grant codeBase "file:${com.sun.aas.installRoot}/lib/jaxr-impl.jar" {
permission java.security.AllPermission;
};
- Type
asant run-queryto invoke the client- Default behavior of
asant run-queryis to contact UDDI business registry and generate the endpoints information dynamically. However the Configurator Web Service also maintains all endpoints information in a local cache accessible by specifying the following argument when invoking the script (Edit therun-querytarget insrc/build.xmlto enter this change):-Dconfigurator.refresh=false
Specifying this option will not invoke the public UDDI business registry and instead provide you with endpoints information from local cache. This cache is also updated every time UDDI registry is contacted for getting the list of endpoints.
5.0 Building from the source
asant run-queryuses the default Configurator Web Service bundled with this application. If you need to use another Configurator Web Service, you need to modify therun-querytarget insrc/build.xmlto specify the following argument when invoking that target
-Dconfigurator.endpoint=<ANOTHER_CONFIGURATOR_ENDPOINT>
To obtain other configurator endpoints, configure server-side logging to CONFIG logging level and set "configurator.refresh" to "true". Search server-side logs for "Configurator" keyword and the endpoint address is available in next CONFIG log entry.- If both -Dconfigurator.endpoint and -Dconfigurator.refresh options are specified, then endpoints information is retrieved in the following manner:
configurator.refresh configurator.endpoint How endpoints are generated true Not specified Configurator Web Service hosted on local server talks to UDDI registry false Not specified Local cache from Configurator Web Service hosted on local server true Specified Remote endpoint talks to UDDI registry false Specified Remote endpoint's local cache
- Client
- Go to src directory and invoke
asant clientcommand.- Follow the instructions in 4.0 to run the client
- Server
- Go to src directory and invoke
asant servercommand.- Before deploying the newly created wsi.war file please follow the instructions in item 6 of Before Working With Samples
6.0 Configuring Logging
The WSI sample application supports the Java Logging API [4]. By default, the logging level has been set to "INFO". The following levels are available, in ascending order of granularity and are used in the application as shown below.
Logging Level Usage SEVERE Server-side or client-side exception WARNING Non blocking error conditions INFO (default) Basic flow of application CONFIG Logging entries from LoggingFacility FINE SOAP request and response messages FINER Entry and exit points of primary methods FINEST Display intermediate steps from the primary methods, if any You can change the default level of logging for the sample application on the client and server side as follows:
7.0 Troubleshooting
- Server-side logging: To change the default logging level on server-side (INFO) to a different level, you need to do the following:
- Add the following line to the INSTALL_ROOT/domains/<domain_name>/config/domain.xml
com.sun.wsi.scm.level=LEVEL
where LEVEL is one of the seven logging levels mentioned above- Restart the Application Server
- Client-side logging: To change the default logging level on client-side (INFO) to a different level, change the last line in config/logging.properties file to
com.sun.wsi.scm.level=LEVEL
where LEVEL is one of the seven logging levels mentioned above
8.0 References
- All the endpoints are configured in the config/endpoints.props file. The default endpoints are configured for host "localhost" and port "8080". If your application is deployed at a different port, then ensure that these are reflected correctly in config/endpoints.props.
- Make sure the database server is started before invoking the Retailer client (
asant run-retailer).- Make sure the database server is running on the correct host and port and the appropriate database has already been created. Refer to section 3.0 for more details.
- Database related properties are stored in wsi-server.war{WEB-INF/conf/db.props} file. If your database server is running at a different port, change db.url property accordingly. The format of the database URL is "jdbc:pointbase:server://localhost:{port}/wsi" where {port} may not be specified if it is the default port. By default, port is set to 9092
- If your Retailer endpoint is outside the firewall, you need to change the
http.proxyHostandhttp.proxyPortproperties in config/build.properties to the proxy host name and port number entries so that they specify the system on your network through which you access the Internet.- You can specify sample application endpoints from other vendors in config/endpoints.props and create different configurations, comprising of endpoints from different vendors, in config/vendor-config.xml. Each of these configurations will be used to place the orders specified in config/order-config.xml. However if your endpoints are deployed inside firewall, then only Retailer Web Service hosted within the firewall can be mixed with other endpoints installed outside firewall.
- To view the SOAP request and response messages, turn the logging level to FINE. Refer to section 6.0 on how to configure logging. SOAP request and response messages are available for Retailer, Logging and Configurator clients as given below:
- Retailer client SOAP request and response messages are available in logs/retailer-soap-messages.txt
- Logging client SOAP request and response messages are available in logs/logging-soap-messages.txt.
- Configurator client SOAP request and response messages are available in logs/configurator-soap-messages.txt.
Server-side log messages are available in INSTALL_ROOT/domain/<domaim_name>/logs/server.log