Attach a service map to a local mapping service to create
a service mapping, which you can use to route or transform requests
sent from a service client to a service provider.
Before you begin
Before you attach a service map to an existing local mapping
service, ensure that you have installed one or more service maps,
and that you have created one or more local mapping services. See Installing a service map by using the command line and Creating a local mapping service by using the command line.
When
you attach a service map to a local mapping service, the local mapping
service must be valid for that service map. A valid local mapping
service is one whose source service properties match the source service
properties defined in the service map. You must collect the service
properties of the provider service that you are routing to before
you attach the service map to the local mapping service. The properties
you require are:
- Endpoint address
- The endpoint address of the service provider that is used by the
web service request that the local mapping service intercepts.
- Port type
- The port type associated with the service request that is intercepted
by the local mapping service. This field is optional.
- Namespace
- The namespace for the service and port.
- Service name
- The name of the web service request that is intercepted by the
local mapping service.
- Port name
- The port name associated with the web service request that is
intercepted by the local mapping service.
About this task
You can attach a service map to a local mapping service
by using wsadmin commands, or by using the administrative console
as described in Attaching a service map to a local mapping service by using the administrative console.
Procedure
- Launch wsadmin by starting the wsadmin scripting tool.
- Use the attachServiceMap command to
attach a service map named Route to a local
mapping service named StockQuoteService, as
the following example shows:
AdminTask.attachServiceMap('StockQuoteService', ['-smName', 'Route'])
The system attaches the service map to the local mapping
service and the command returns a message that the attachment is complete.
- Save your configuration changes by using the following
command:
AdminConfig.save()
Requests are now intercepted, and can be rerouted, transformed,
or both.
- 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
You have attached the selected service map to the local
mapping service.
Note: The default state of the local mapping service
is
started, whether or not a service map is attached
to that local mapping service. To stop intercepting requests, change
the local mapping service state to
stopped. For
more information, see
Stopping a local mapping service by using the command line.
What to do next
Optional: start the local mapping service, if it is not already
started. See
Starting a local mapping service by using the command line.
Optional:
set an event point on the service mapping that you have created, so
that you can monitor requests that are being intercepted by the local
mapping service, and log them. For more information, see Creating an event point on a local mapping service by using the command line.