title: Web service in clustered environment
body: <p>I have a web service running on two clusters and the loadbalancer decides where to forward the requests. Because of firewall rules the client machine can see the loadbalancer only and the two application servers can not see the loadbalancer. I have the following wsdl files on clusters:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-10-. --&gt;
  &lt;definitions targetNamespace="http://contract.company-europe.com/" name="contractServiceService"
               xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy"
               xmlns:tns="http://contract.company-europe.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
               xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
               xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
      &lt;wsp:Policy wsu:Id="contractAgreementServicePortBinding_getcontractAgreement_WSAT_Policy"
                  xmlns:wsat="http://schemas.xmlsoap.org/ws/2004/10/wsat"&gt;
          &lt;wsat:ATAlwaysCapability/&gt;
          &lt;wsat:ATAssertion wsp:Optional="true" ns2:Optional="true"
                            xmlns:ns2="http://schemas.xmlsoap.org/ws/2002/12/policy"/&gt;
      &lt;/wsp:Policy&gt;
      &lt;types&gt;
          &lt;xsd:schema&gt;
              &lt;xsd:import namespace="http://contract.company-europe.com/"
                          schemaLocation="schemaLocation="http://loadbalancer/merlin/contractAgreementService?wsdl&amp;resource=contractAgreementServiceService_schema.xsd"/&gt;
          &lt;/xsd:schema&gt;
      &lt;/types&gt;
      &lt;message name="getcontractAgreement"&gt;
          &lt;part name="parameters" element="tns:getcontractAgreement"/&gt;
      &lt;/message&gt;
      &lt;message name="getcontractAgreementResponse"&gt;
          &lt;part name="parameters" element="tns:getcontractAgreementResponse"/&gt;
      &lt;/message&gt;
      &lt;message name="IOException"&gt;
          &lt;part name="fault" element="tns:IOException"/&gt;
      &lt;/message&gt;
  
      &lt;message name="MerlinBaseException"&gt;
          &lt;part name="fault" element="tns:MerlinBaseException"/&gt;
      &lt;/message&gt;
  
      &lt;portType name="contractAgreementService"&gt;
          &lt;operation name="getcontractAgreement"&gt;
              &lt;input wsam:Action="http://contract.company-europe.com/contractAgreementService/getcontractAgreementRequest"
                     message="tns:getcontractAgreement"/&gt;
              &lt;output wsam:Action="http://contract.company-europe.com/contractAgreementService/getcontractAgreementResponse"
                      message="tns:getcontractAgreementResponse"/&gt;
              &lt;fault message="tns:IOException" name="IOException"
                     wsam:Action="http://contract.company-europe.com/contractAgreementService/getcontractAgreement/Fault/IOException"/&gt;
              &lt;fault message="tns:MerlinBaseException" name="MerlinBaseException"
                     wsam:Action="http://contract.company-europe.com/contractAgreementService/getcontractAgreement/Fault/MerlinBaseException"/&gt;
          &lt;/operation&gt;
      &lt;/portType&gt;
  
      &lt;binding name="contractAgreementServicePortBinding" type="tns:contractAgreementService"&gt;
          &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt;
          &lt;operation name="getcontractAgreement"&gt;
              &lt;wsp:PolicyReference URI="#contractAgreementServicePortBinding_getcontractAgreement_WSAT_Policy"/&gt;
              &lt;soap:operation soapAction=""/&gt;
              &lt;input&gt;
                  &lt;wsp:PolicyReference URI="#contractAgreementServicePortBinding_getcontractAgreement_WSAT_Policy"/&gt;
                  &lt;soap:body use="literal"/&gt;
              &lt;/input&gt;
              &lt;output&gt;
                  &lt;wsp:PolicyReference URI="#contractAgreementServicePortBinding_getcontractAgreement_WSAT_Policy"/&gt;
                  &lt;soap:body use="literal"/&gt;
              &lt;/output&gt;
              &lt;fault name="IOException"&gt;
                  &lt;soap:fault name="IOException" use="literal"/&gt;
              &lt;/fault&gt;
              &lt;fault name="MerlinBaseException"&gt;
                  &lt;soap:fault name="MerlinBaseException" use="literal"/&gt;
              &lt;/fault&gt;
          &lt;/operation&gt;
      &lt;/binding&gt;
      &lt;service name="contractAgreementServiceService"&gt;
          &lt;port name="contractAgreementServicePort" binding="tns:contractAgreementServicePortBinding"&gt;
              &lt;soap:address location="http://loadbalancer/merlin/contractAgreementService"/&gt;
          &lt;/port&gt;
      &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>Is it correct that the soap address and the xsd is pointing to the loadbalancer or should they use the local cluster1/cluster2 address?</p>
  
  <p><strong>UPDATE1</strong></p>
  
  <p>Unfortunately I got the following error message. This happens in clustered environment only:</p>
  
  <pre><code>2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:100) -  - REQUEST URI       =/merlin/contractAgreementService
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:101) -  -           authType=null
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:102) -  -  characterEncoding=utf-8
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:103) -  -      contentLength=273
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:104) -  -        contentType=text/xml; charset=utf-8
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:105) -  -        contextPath=/merlin
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=content-type=text/xml; charset=utf-8
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=soapaction="http://rental.company-europe.com/contractAgreementService/getContractAgreementRequest"
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=host=loadbalancer
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=content-length=273
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=expect=100-continue
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:118) -  -             header=connection=Keep-Alive
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:121) -  -             locale=en_GB
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:122) -  -             method=POST
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:134) -  -          parameter=wsdl=
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:136) -  -           pathInfo=null
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:137) -  -           protocol=HTTP/1.1
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:138) -  -        queryString=wsdl
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:139) -  -         remoteAddr=10.101.98.79
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:140) -  -         remoteHost=10.101.98.79
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:141) -  -         remoteUser=null
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:142) -  - requestedSessionId=null
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:143) -  -             scheme=http
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:144) -  -         serverName=loadbalancer
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:145) -  -         serverPort=80
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:146) -  -        servletPath=/contractAgreementService
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:147) -  -           isSecure=false
  [2011-11-03 09:43:21,937] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:148) -  - ---------------------------------------------------------------
  [2011-11-03 09:43:21,937] DEBUG (org.jboss.ws.core.soap.MessageContextAssociation:46) -  - pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@77c1ca7 (Thread http-FXPEARLAP2%2F10.101.117.5-58080-2)
  [2011-11-03 09:43:21,937] DEBUG (org.jboss.ws.core.soap.MessageFactoryImpl:215) -  - createMessage: [contentType=text/xml; charset=utf-8]
  [2011-11-03 09:43:21,937] DEBUG (org.jboss.ws.metadata.umdm.EndpointMetaData:732) -  - Configure SOAPBinding
  [2011-11-03 09:43:21,937] ERROR (org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS:149) -  - SOAP request exception
  java.io.IOException
      at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:763)
      at org.apache.coyote.http11.InternalAprInputBuffer$SocketInputBuffer.doRead(InternalAprInputBuffer.java:792)
      at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
      at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:703)
      at org.apache.coyote.Request.doRead(Request.java:428)
      at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:297)
      at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
      at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:312)
      at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
      at org.jboss.wsf.common.IOUtils.copyStream(IOUtils.java:69)
      at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:224)
      at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:195)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:447)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
      at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
      at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:151)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
      at java.lang.Thread.run(Thread.java:662)
  [2011-11-03 09:43:21,953] DEBUG (org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS:269) -  - Cannot obtain fault meta data for: class java.io.IOException
  [2011-11-03 09:43:21,953] DEBUG (org.jboss.ws.core.soap.MessageContextAssociation:75) -  - popMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@77c1ca7 (Thread http-FXPEARLAP2%2F10.101.117.5-58080-2)
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:154) -  - ---------------------------------------------------------------
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:155) -  -           authType=null
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:156) -  -      contentLength=-1
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:157) -  -        contentType=text/xml;charset=UTF-8
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:168) -  -             header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)/JBossWeb-2.0
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:168) -  -             header=Content-Type=text/xml;charset=UTF-8
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:168) -  -             header=Transfer-Encoding=chunked
  [2011-11-03 09:43:21,953] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:168) -  -             header=Date=Thu, 03 Nov 2011 09:43:21 GMT
  [2011-11-03 09:43:21,968] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:168) -  -             header=Connection=close
  [2011-11-03 09:43:21,968] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:170) -  -            message=null
  [2011-11-03 09:43:21,968] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:171) -  -         remoteUser=null
  [2011-11-03 09:43:21,968] INFO  (org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]:172) -  -             status=500
  </code></pre>
  
  <p>Do you know what it means? I put some logs into the contract service itself and I do not see them, so there might be some problems with the request?</p>