Create a local mapping service to define which service
client requests are intercepted.
Before you begin
Before you can create a local mapping service you must
collect the details of the provider service that is being intercepted.
The endpoint address, service name, and namespace are required. Specifying
the port type is optional.
About this task
When a local mapping service is created, you can attach
an installed service map to that local mapping service to create a
service mapping, so that intercepted service requests can be transformed,
rerouted, or both.
You can create a local mapping service by
using wsadmin commands, or by using the administrative console as
described in Creating a local mapping service by using the administrative console.
When
you create a local mapping service by using the command line, you
can choose to attach a service map by using the optional -attachSMName parameter,
or you can return to a created local mapping service later to attach
a service map.
Procedure
- Launch wsadmin by starting the wsadmin scripting tool.
- Use the following createLMservice command
to create a new local mapping service named StockQuoteService with
an attached service map named Route:
AdminTask.createLMService('-name StockQuoteService -description "Stock Quote JAX-WS service" -attachSMName Route -consumedService [-targetEndpoint http://localhost:9080/StockQuote/sqservice -namespace http://test -serviceName sqservice -portName sqport -portType sqType]')
The
createLMService command creates
the local mapping service and returns the name of the newly created
local mapping service. For example:
'StockQuoteService'
For
more information about the createLMService command
and its parameters, see createLMService command.
- Optional: Use the showLMService command
to review your changes. To run the showLMservice command,
you must provide the name of the local mapping service that was returned
by the createLMService command. For
this example:
AdminTask.showLMService('StockQuoteService')
Alternatively, you can view a list of all local mapping services
by using the listLMServices command: AdminTask.listLMServices()
- Save your configuration changes by using the following
command:
AdminConfig.save()
- If you are in a clustered environment, you must synchronize
the nodes. Use the syncActiveNodes script in the AdminNodeManagement
script library to synchronize each active node in your environment,
as the following example demonstrates:
AdminNodeManagement.syncActiveNodes()
Results
A new local mapping service has been created. The state
of the new local mapping service is started.