HowTo monitor a JAX-WS Client with a Reverse Proxy
Membrane SOA Monitor can be placed between a JAX-WS client and a service in two different ways. One way is to use a HTTP proxy as described in Monitoring a JAX-WS client with a ProxySelector. The other possibility is to use Membrane Monitor as reverse proxy. To do that the endpoint address in the client has to be modified so that it sends its requests to the monitor. the monitor then forwards the requests to the service.
Start the monitor and click on the green button.

Figure 1:
Using the rule above will cause the monitor to listen to port 2000 and to forward each SOAP call to port 8080 on the local host. You can find more about rules in the quickstart guide.
Then we have to change the client code. The client should connect to the monitor running on port 2000 instead to the service on port 8080. To manipulate the endpoint address we have to put a property with the URL of the monitor into the ReqestContext. This can be done by a code snippet like the one in the listing below.
BookAddServiceService service = new BookAddServiceService(); BookAddService port = service.getBookAddServicePort(); ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:2000/BookAddService/BookAddServiceService"); port.addBook(0, "Herr der Ringe", "J. R. Tolkien");
The code in bold letters changes the endpoint address to the address of the monitor. Important is the changed port number of 2000.
Now you can run your client and have a look at the messages in the user interface of the monitor.
