Runtime components : Core components : Web services access : Accessing Web services : Configuring the Web services access path in the Web services connector : Defining a relative path for an endpoint address
  
Defining a relative path for an endpoint address
You can specify a relative path for the endpointAddress attribute, which makes it easier to switch between different Web services servers. In the following example definition of a Web services connector, the server1 variable in the endpointAddress attribute delegates a Web services server.
< JaxWsConnector id=”PeopleService”
namespaceUri=http://mock.dallas.com/
serviceName="PeopleServicesService"
portName="PeopleServicesPort"
serviceEndpointInterface="com.dallas.mock.PeopleServicesDelegate"
wsdlUrl="/WEB-INF/wsdl/PeopleServicesService.wsdl"/
endpoint Address=”${server1}/TestWebservices/PeopleService”>
To ensure that the server1 variable is understood at run time, the variable for target Web services server needs to be resolved to a real URL address during run time. You can configure a variable resolver implementation class in the btt.xml file as shown in the following example:
<kColl id="WebServices">
  <field id="VariableResolver"
value="com.ibm.btt.services.ws.endpoint.DefaultVariableResolver"/>
  <kColl id="servers">
    <!-- Configure server environment info consumed by default variable resolver -->
    < field id="server1" value="http://127.0.0.1:9080" >
  </kColl>
</kColl>
As shown in Variable resolver class hierarchy, a variable resolver interface is provided by UDTT. A default implementation class, DefaultVariableResolver, is provided by UDTT. You can implement the IVariableResolver interface to define the order in which variables are resolved.
Variable resolver class hierarchy
This graphic is described in the surrounding text.
The default implementation for a variable resolver uses the following order: Firstly, it is verified whether there is a server1 WAS environment variable. If not, it will check whether the server1 variable named is defined in the btt.xml file. The name of the variable is replaced with its value during run time. If the variable cannot be resolved by the variable resolver, the default endpoint address is used.
Go up to
Configuring the Web services access path in the Web services connector