You can use property files to manage or change endpoint
URL fragments for web services accessed through HTTP, SOAP and Java™ Message Service (JMS), or directly
as enterprise beans. URL fragments are used to form complete web services
endpoint addresses included in published Web Services Description
Language (WSDL) files.
Before you begin
Endpoint URL fragments are optional metadata for web services
applications. You can use either the administrative console or property
files to configure and manage URL fragments. Before you can query
the URL fragments, you must first set the URL fragments using either
the administrative console or the applyConfigProperties command. After
you initially set the URL fragments using the administrative console
or property files, you can now modify the web services endpoint URL
fragment using property files or the administrative console.
To
learn about using the administrative console to set the URL fragments,
see the information about configuring endpoint URL information for
HTTP bindings or configuring endpoint URL information for JMS bindings.
About this task
Version 8.0 and later supports using property files to manage
endpoint URL fragments for web services accessed through HTTP, SOAP
and Java Message Service (JMS),
or directly as enterprise beans.You can specify a portion of the
endpoint URL to use in each web service module. The portion that you
specify is used to create the actual endpoint URL when publishing
a WSDL file. In a published WSDL file, the URL defining the target
endpoint address is found in the location attribute of the port soap:address
element. This page applies for both Java API
for XML-Based Web Services (JAX-WS) and Java API
for XML-based RPC (JAX-RPC) web services.
The web service endpoint
URL fragment properties are extensions to the application properties
file. When using the extractConfigProperties command to get a properties
file for an application, you also get the endpoint URL fragments along
with other application properties. Use the applyConfigProperties,
validateConfigProperties, and deleteConfigProperties commands; as
described in the procedure, to update, validate and delete endpoint
URL fragments in a web services application.
Procedure
- Extract the property file.
For example, to
extract the properties for the application, sampleApplication, use
the extractConfigProperties command.
AdminTask.extractConfigProperties(['-propertiesFileName', 'myProperties.props', '-configData',
'Deployment=sampleApplication' ])
If you previously
configured your web services endpoint URL fragments, the system extracts
the properties files and the result contains a section for endpoint
URL fragments, as the following example displays:
#
# CWSAD0103I: URLPrefixMap Section: module=TestApp.jar
#
ResourceType=Application
ImplementingResourceType=Application
ResourceId=Cell=!{cellName}:Deployment=!{applicationName}
ExtensionId=ApplicationWebServicesExtension
#
#
#Properties
http=http://myhostname:80
module=TestApp.jar
- Create a new instance of the property file.
If
you modify existing URL fragment properties or create new properties,
use the following command to apply URL fragment properties. This
command creates or updates the corresponding metadata file in the
specified application. In this example, the optional
-reportFileName
parameter
is used to specify to produce a report from the command.
AdminTask.applyConfigProperties('[-propertiesFileName myProperties.props -reportFileName report.txt ]')
- Validate the property file.
The validateConfigProperties
command validates the property names and values in the properties
file. If all the names and values are valid, the command result is
true. Otherwise, the command returns a false value; for example:
AdminTask.validateConfigProperties(['-propertiesFileName', 'myProperties.props', '-reportFileName',
'report.txt'])
- Delete the property file.
When a deleteConfigProperties
command is invoked, the command deletes all of the properties that
are specified within the properties file. If you are starting with
a previously extracted properties file, remove all sections within
the properties file, except for the sections that you want to apply
the deleteConfigProperties command. For example, if you want to delete
a URL Prefix Map, remove all sections from the extracted properties
file except the URLPrefix map section and possibly the environment
variables section, if you are using variables.
The deleteConfigProperties
command deletes the properties specified in the properties file; for
example:
AdminTask.deleteConfigProperties(['-propertiesFileName', 'myProperties.props', '-reportFileName',
'report.txt'])
The following myProperties.txt file
is an example of a properties file that you can use to perform a delete
of the http
URL Prefix map for the TestApp.jar module:
#
# CWSAD0103I: URLPrefixMap Section: module=TestApp.jar
#
ResourceType=Application
ImplementingResourceType=Application
ResourceId=Cell=!{cellName}:Deployment=!{applicationName}
ExtensionId=ApplicationWebServicesExtension
#
#
#Properties
http=http://myhostname:80
module=TestApp.jar
#
#
EnvironmentVariablesSection
#
#
#Environment Variables
applicationName=TestApp
cellName=XYZNode01Cell
serverName=server1
nodeName=XYZNode01
Results
You can use web services property files to query, configure,
and manage the web service endpoint URL fragment for different protocols.