13.2. Configure the webservices Subsystem

Many configuration options are available for the webservices subsystem, which controls the behavior of Web Services deployed into JBoss EAP 6. The command to modify each element in the Management CLI script (EAP_HOME/bin/jboss-cli.sh or EAP_HOME/bin/jboss-cli.bat) is provided. Remove the /profile=default portion of the command for a standalone server, or modify it to modify the subsystem for a different profile on a managed domain.
Published Endpoint Address

You can rewrite the <soap:address> element in endpoint-published WSDL contracts. This ability can be used to control the server address that is advertised to clients for each endpoint. Each of the following optional elements can be modified to suit your needs. Modification of any of these elements requires a server restart.

Table 13.1. Configuration Elements for Published Endpoint Addresses

Element Description CLI Command
Whether to always modify the WSDL address. If true, the content of <soap:address> will always be overwritten. If false, the content of <soap:address> will only be overwritten if it is not a valid URL. The values used will be the wsdl-host, wsdl-port, and wsdl-secure-port described below.
The hostname / IP address to be used for rewriting <soap:address>. If wsdl-host is set to the string jbossws.undefined.host, the requestor's host is used when rewriting the <soap:address>.
wsdl-port An integer which explicitly defines the HTTP port that will be used for rewriting the SOAP address. If undefined, the HTTP port is identified by querying the list of installed HTTP connectors.
wsdl-secure-port An integer which explicitly defines the HTTPS port that will be used for rewriting the SOAP address. If undefined, the HTTPS port is identified by querying the list of installed HTTPS connectors.
Predefined Endpoint Configurations

You can define endpoint configurations which can be referenced by endpoint implementations. One way this might be used is to add a given handler to any WS endpoint that is marked with a given endpoint configuration with the annotation @org.jboss.ws.api.annotation.EndpointConfig.

JBoss EAP 6 includes a default Standard-Endpoint-Config. An example of a custom configuration, Recording-Endpoint-Config, is also included. This provides an example of a recording handler. The Standard-Endpoint-Config is automatically used for any endpoint which is not associated with any other configuration.
To read the Standard-Endpoint-Config using the Management CLI, use the following command:
Endpoint Configurations

An endpoint configuration, referred to as an endpoint-config in the Management API, includes a post-handler-chain, post-handler-chain and some properties, which are applied to a particular endpoint. The following commands read and add and endpoint config.

Example 13.1. Read an Endpoint Config


Example 13.2. Add an Endpoint Config

Handler Chains

Each endpoint config may be associated with PRE and POST handler chains. Each handler chain may include JAXWS-compliant handlers. For outbound messages, PRE handler chain handlers are executed before any handler attached to the endpoints using standard JAXWS means, such as the @HandlerChain annotation. POST handler chain handlers are executed after usual endpoint handlers. For inbound messages, the opposite applies. JAX-WS is a standard API for XML-based web services, and is documented at http://jcp.org/en/jsr/detail?id=224.

A handler chain may also include a protocol-binding attribute, which sets the protocols which trigger the chain to start.

Example 13.3. Read a Handler Chain


Example 13.4. Add a Handler Chain


A JAXWS handler is a child element <handler>, within a handler chain. The handler takes a class attribute, which is the fully-qualified classname of the handler class. When the endpoint is deployed, an instance of that class is created for each referencing deployment. Either the deployment classloader or the classloader for module org.jboss.as.webservices.server.integration must be able to load the handler class.

Example 13.5. Read a Handler


Example 13.6. Add a Handler

Runtime Information About Web Services

You can view runtime information about Web Services, such as the web context and the WSDL URL, by querying the endpoints themselves. You can use the * character to query all endpoints at once. The following two informations show the command for a server in a managed domain, then a standalone server.

Example 13.7. View Runtime Information about All Endpoints on A Server In A Managed Domain

This command shows information about all endpoints on the server called server-one hosted on physical host master in a managed domain.

Example 13.8. View Runtime Information about All Endpoints on A Server In A Standalone Server

This command shows information about all endpoints on a standalone server named server-one on a physical host named master.

Example 13.9. Example Endpoint Information

The following is example, hypothetical output.
   "outcome" => "success",
   "result" => [{
       "address" => [
           ("deployment" => "jaxws-samples-handlerchain.war"),
           ("subsystem" => "webservices"),
           ("endpoint" => "jaxws-samples-handlerchain:TestService")
       "outcome" => "success",
       "result" => {
           "class" => "org.jboss.test.ws.jaxws.samples.handlerchain.EndpointImpl",
           "context" => "jaxws-samples-handlerchain",
           "name" => "TestService",
           "type" => "JAXWS_JSE",
           "wsdl-url" => "http://localhost:8080/jaxws-samples-handlerchain?wsdl"