JAXM Configuration
You have now seen and deployed all of the code for both the sender and receiver parts of the JAXM message echo example. If, however, you were to start your web browser and point it at http://localhost:8080/SOAPRPSender/request, which is the URL that causes the sender servlet to transmit a message, you would find that after about 30 seconds, the sender would give up waiting for a reply from the receiver and an error page would be displayed by the browser. Although all of the code is in place, the proper JAXM configuration has not been set up to allow the providers to exchange messages. In this section, we look at how to configure the JAXM reference implementation.
Configuring JAXM Clients
A message traveling from the sending servlet to the receiver has to make three hops:
From the sender to the local provider
From the local provider to the remote provider
From the remote provider to the receiving servlet
We saw earlier that a JAXM client logically connects to its local
provider using the ProviderConnectionFactory
createConnection( ) method, but we
didn’t see how the provider itself is located. This
information is held in a file called client.xml,
which must be located in the CLASSPATH of the JAXM
client. Since both the sender and the receiver servlets in this
example are deployed as web applications, their
client.xml files should be placed in the
WEB-INF/classes directory of their WAR files, as shown in the following listing of the files that make up the web archive ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access