Editing the AppProperties and XML Mappings Files

Two files are created when generating WebLogic Web services. These are the AppProperties.properties file and the XML Mappings file. These files must be edited each time you generate a Web service.

See Building Web Services Using BEA WebLogic 7.0 for step-by-step instructions on how to create and edit these files.

The AppProperties File

The AppProperties.properties file should be in the class path of the server. For convenience, an AppProperties.properties file is created for every Web service that is generated; however, in a production environment, there should be only one AppProperties.properties file per server. If multiple Web services are deployed on one server, the App.Properties file in the class path should be edited to add all the services and the service settings to that file.

A typical Synapta Services Builder for Screens AppProperties.properties file should look like this:

#Global Properties
Mapper.Configuration.Filename=c:/Attachmate/EAI/DemoFiles/JavaOne_2002_SP4Mappings.xml
Mapper.Classname=com.attachmate.sc.ws.runtime.weblogic.MapperImpl
Connector.Proxy.Classname=com.attachmate.sc.ws.runtime.weblogic.DirectConnectorAccessProxy
Username=system
Password=security

#Web Service JavaOne_2002_SP4 Specific Properties
JavaOne_2002_SP4.Connector.Proxy.Classname=com.attachmate.sc.ws.runtime.weblogic.ConnectorAccessProxy
JavaOne_2002_SP4.Username=system
JavaOne_2002_SP4.Password=security

The #Global Properties section defines the XML mappings file, which stores the mappings between the Resource Adapter Application Views and services with the Web Service operations. It also has the implementation classnames of the Mapper and the ConnectorProxy, and it stores the global username and password which has access to the Application Views.

The #Web Service section defines the service properties, which can be used to override the global properties. For example, if a username is provided in the second section, that username, rather than the one in the global section, will be used. These credentials are set in the WebLogic realm. The ConnectorProxy is used to isolate the service code from the IConnectorAccess implementation.

XML Mappings

A typical XML Mappings file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<Mappings>
	<Mapping appViewName="JavaOne_2002_SP4" host="localhost" key="JavaOne_2002_SP4_show" port="7001" serviceName="show" taskFile="file:/C:/Attachmate/EAI/recordings/JavaOne_2002			_SP4/connector/JavaOne_2002_SP4.xml"/>
	<Mapping appViewName="JavaOne_2002_SP4" host="localhost" key="JavaOne_2002_SP4_query" port="7001" serviceName="query" taskFile="file:/C:/Attachmate/EAI/recordings/JavaOne_2002	_SP4/connector/JavaOne_2002_SP4.xml"/>
	<Mapping appViewName="JavaOne_2002_SP4" host="localhost" key="JavaOne_2002_SP4_add" port="7001" serviceName="add" taskFile="file:/C:/Attachmate/EAI/recordings/JavaOne_2002	_SP4/connector/JavaOne_2002_SP4.xml"/>
</Mappings>

This file is used to map the application views and services to the Web Service operations. The Web service uses the AppProperties to load these settings and uses these properties when it talks to the underlying resource adapter client classes. Using this file, it is possible to configure the Web Service to talk to a WebLogic server running on a different machine. The host and port attributes refer to the application server.

Related Topics
Bullet Using Web Services
Bullet Building Web Services Using BEA WebLogic 7.0
Bullet BEA WebLogic 7.0 Sample Code
  Attachmate