Create endpoint references using the Web Services Addressing support
Endpoint references targets Web service endpoints. Perform this task if you are writing an application that uses the WS-Addressing.
WS-Addressing can specify the endpoint address or allow WAS to generate it at run time
You can also specify the behavior of endpoint references within a cluster environment.
Create an endpoint reference by performing one of the following steps.
- To create an endpoint reference with an address specified directly, use the WS-Addressing method...
EndpointReferenceManager.createEndpointReference(URI address)This method is useful in test scenarios, where the address of the service does not change.
- To create an endpoint reference with an address that is automatically generated by WAS, perform the following steps.
- If you created the Web service deployment descriptor file, webservices.xml, manually, ensure that...
webservice-description-name...is the same as the local part of the WSDL service name.
If webservices.xml was generated using the tools provided, the names match by default. This match is required for the generation of the correct URI for the endpoint reference.
- Create the endpoint reference using the method that is appropriate for the object that the reference will represent:
- If you are creating an endpoint reference to represent a stateful session bean that maintains in-memory state, create the endpoint reference using...
EndpointReferenceManager.createEndpointReference(QName serviceName, String endpointName, Remote statefulSessionBean)This method ensures that requests that are targeted at the endpoint are not workload-managed. Additionally, if high availability for stateful session beans is specified, the endpoint reference remains valid even if the stateful session bean is failed over.
- If you are creating an endpoint reference to represent any other object, create the endpoint reference using...
EndpointReferenceManager.createEndpointReference(QName serviceName, String endpointName)The combination of service name and endpoint name must be unique within the server. If there is more than one Web service application with the same service name and endpoint name, the appserver cannot generate a unique URI object for the endpoint. If you cannot ensure that the combination of service name and endpoint name is unique, use an SPI method to create the endpoint reference.
Because the endpoint reference might be workload managed at a later date, ensure that the endpoint does not contain any in-memory state.
When the application invokes either of the previous two methods, WAS generates the address URI for the endpoint reference, and puts the service name and endpoint name into the metadata of the newly created endpoint reference.
if you configured a virtual host for the server on which the endpoint is created, the URI of the endpoint reference refers to the virtual host of the HTTP server's configuration.
You can override the HTTP endpoint URL information using the console. The methods described previously will use the overridden value to generate the address URI for the endpoint reference.
Results
You created an endpoint reference for use by your application.
What to do next
Related concepts
Web Services Addressing, firewalls and intermediary nodes
Web Services transactions, firewalls and intermediary nodes
Memory-to-memory replication
Related tasks
Create a Web service application that is referenced through a Web Services Addressing endpoint reference
Related Reference
Stateful session beans failover settings (applications)
Stateful session beans failover settings (EJB modules)