Multiple virtual host and soap:address problem and our patch to jbossws

Working on our ws we found a trouble with soap:address location in wsdl happening if the server answers to multiple addresses.
I’ll describe our environment to better explain the problem:

We have a cluster of about 10 jboss/linux servers with an active weighted load balancer (2 real machines in vrrp cluster active-active) in front of them (linux virtual server LVS). The virtual addresses configured in LVS are from 10 to 20 depending on test addresses configured for partners and similar situations. Some scripts monitor each real server’s healt and decide whether the cluster’s topology has to be changed. In order to have a simple and understandable description, I’m describing the production cluster only. We also have development and integration test clusters affected by the same issue I’m going to describe; in fact, these clusters are even more dynamic than the production one because of the frequent address changes, the high number of joined machines, the continuous restarts, and so on making it more concerned by the problem described here.

The WSDL, that is a required deployment artifact for an endpoint, has a soap:address element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
The problem of soap:adress declared in wsdl in environment like our is the following: while a server answers to different virtual addresses, the location of the endpoint (soap:address) declared in the wsdl and obtained from the contextServlet could be either the address setted on the wsdl at deploy time or
the address setted in properties of the file jbossws.beans/META-INF/jboss-beans.xml (webServiceHost, webServicePort, alwaysModifySOAPAddress).

Both addresses are staticaly mapped (in the wsdl or on the server configuration file) and this is the problem in our environment (but would be a problem also on more trivial environment with one multiheaded machine!). Note that this issue concerns the wsdl generation phase only; of course webservice calls work perfectly with all virtual addresses. In fact the problem is present also on the ContextServlet (is the servlet called when you ask for the list of deployed services), but it’s a minor trouble.

For these reasons we decided to make a patch over jbossws. Our patch adds a configuration parameter in jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml named rewriteSOAPAddressWithCalledHost (true/false). If this parameter is set to true soap:address is rewrited using the host and port used by the client to get the wsdl, and also the ContextServlet does the same. Of course it solves the problem because soap:address and url in ContextServlet depend on the Virtual host used while asking them.
Without this patch, the only solution for us was to provide our customers with personalized static wsdl having soap:address modified to match the correct virtual address. Of course it was time wasting and made change management very very hard.

Our patch is posted on jbossws jira at http://jira.jboss.com/jira/browse/JBWS-1178 hoping it could be useful for some other people. If you are interested in making it part of standard jbossws please vote for them!
I also attached it here You have to apply it on jbossws-1.0.3 source code (tag on jboss svn)

4 Responses to “Multiple virtual host and soap:address problem and our patch to jbossws”

  1. Stepan [Visitor] says:

    Hm, this looks like the thing I am looking for entire day.. Thanks very much!!!

  2. Martin [Visitor] says:

    Hi. I can’t apply the patch. I use TortoiseSVN, and when I try to apply the patch (rigth button, “Apply patch”), I get the following error:
    ” The line “Index: ” was not found!
    Either this is not a diff file or the diff is empty. “.

    ¿The patch file is corrupted?

  3. спасибо вам за то что существует ещё такой сайт

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>