title: soap web service response very slow
body: <p>I generated a soap web service </p>
  
  <p>and when I try to consume this service I have a problem</p>
  
  <p>it takes many time to get the response ( more than 4 minutes )</p>
  
  <p>I try with this test code :</p>
  
  <pre><code>import javax.jws.WebMethod;
  import javax.jws.WebService;
  import javax.jws.soap.SOAPBinding;
  import javax.jws.soap.SOAPBinding.Style;
  
  @WebService
  @SOAPBinding(style = Style.RPC)
  public interface Balance {
  
  
      @WebMethod String getValue();
  
  }
  </code></pre>
  
  <p>this is the java class</p>
  
  <pre><code>import javax.jws.WebService;
  
  
  
  @WebService(endpointInterface = "com.dq.test.web.manager.impl.Balance")
  public class BalanceImp implements Balance{
  
  
      @Override
      public String getValue() {
          // TODO Auto-generated method stub
          return "test";
      }
  
  
  }
  </code></pre>
  
  <p>to publish this web service I used this code :</p>
  
  <p>Endpoint.publish("<a href="http://192.168.1.13:8080/WS/TestSoap" rel="nofollow">http://192.168.1.13:8080/WS/TestSoap</a>", new BalanceImp());</p>
  
  <p>this is the code of wsdl :</p>
  
  <pre><code>&lt;!--
   Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
  --&gt;
  &lt;!--
   Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
  --&gt;
  &lt;definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.manager.web.test.dq.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://impl.manager.web.test.dq.com/" name="BalanceImpService"&gt;
  &lt;types/&gt;
  &lt;message name="getValue"/&gt;
  &lt;message name="getValueResponse"&gt;
  &lt;part name="return" type="xsd:string"/&gt;
  &lt;/message&gt;
  &lt;portType name="Balance"&gt;
  &lt;operation name="getValue"&gt;
  &lt;input message="tns:getValue"/&gt;
  &lt;output message="tns:getValueResponse"/&gt;
  &lt;/operation&gt;
  &lt;/portType&gt;
  &lt;binding name="BalanceImpPortBinding" type="tns:Balance"&gt;
  &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/&gt;
  &lt;operation name="getValue"&gt;
  &lt;soap:operation soapAction=""/&gt;
  &lt;input&gt;
  &lt;soap:body use="literal" namespace="http://impl.manager.web.test.dq.com/"/&gt;
  &lt;/input&gt;
  &lt;output&gt;
  &lt;soap:body use="literal" namespace="http://impl.manager.web.test.dq.com/"/&gt;
  &lt;/output&gt;
  &lt;/operation&gt;
  &lt;/binding&gt;
  &lt;service name="BalanceImpService"&gt;
  &lt;port name="BalanceImpPort" binding="tns:BalanceImpPortBinding"&gt;
  &lt;soap:address location="http://192.168.1.13:8080/WS/TestSoap"/&gt;
  &lt;/port&gt;
  &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>I used eclipse in order to generate and test the client :</p>
  
  <p>this is the test code :</p>
  
  <pre><code>BalanceImpServiceLocator loc = new BalanceImpServiceLocator();
  BalanceImpPortBindingStub bindingStub = new BalanceImpPortBindingStub(new URL(loc.getBalanceImpPortAddress()),loc);
  
  System.out.println(" -- start test ----");
  
  String string = bindingStub.getValue()
  </code></pre>
  
  <p>I try with another  wsdl example   which is published in the net ( <a href="http://www.webservicex.net/WeatherForecast.asmx?WSDL" rel="nofollow">http://www.webservicex.net/WeatherForecast.asmx?WSDL</a> ).</p>
  
  <p>I generate the client using also eclipse .</p>
  
  <p>the response is very fast for this example .</p>
  
  <p>this is the source code for this example :</p>
  
  <pre><code>wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.webservicex.net" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.webservicex.net"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for valid zip code or Place name in USA
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:types&gt;
  &lt;s:schema elementFormDefault="qualified" targetNamespace="http://www.webservicex.net"&gt;
  &lt;s:element name="GetWeatherByZipCode"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="GetWeatherByZipCodeResponse"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="1" maxOccurs="1" name="GetWeatherByZipCodeResult" type="tns:WeatherForecasts"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:complexType name="WeatherForecasts"&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="1" maxOccurs="1" name="Latitude" type="s:float"/&gt;
  &lt;s:element minOccurs="1" maxOccurs="1" name="Longitude" type="s:float"/&gt;
  &lt;s:element minOccurs="1" maxOccurs="1" name="AllocationFactor" type="s:float"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="FipsCode" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="PlaceName" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="StateCode" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="Status" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="Details" type="tns:ArrayOfWeatherData"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;s:complexType name="ArrayOfWeatherData"&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="unbounded" name="WeatherData" type="tns:WeatherData"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;s:complexType name="WeatherData"&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="Day" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="WeatherImage" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="MaxTemperatureF" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="MinTemperatureF" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="MaxTemperatureC" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="MinTemperatureC" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;s:element name="GetWeatherByPlaceName"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="PlaceName" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="GetWeatherByPlaceNameResponse"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="1" maxOccurs="1" name="GetWeatherByPlaceNameResult" type="tns:WeatherForecasts"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="WeatherForecasts" type="tns:WeatherForecasts"/&gt;
  &lt;/s:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeSoapIn"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetWeatherByZipCode"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeSoapOut"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetWeatherByZipCodeResponse"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameSoapIn"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetWeatherByPlaceName"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameSoapOut"&gt;
  &lt;wsdl:part name="parameters" element="tns:GetWeatherByPlaceNameResponse"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeHttpGetIn"&gt;
  &lt;wsdl:part name="ZipCode" type="s:string"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeHttpGetOut"&gt;
  &lt;wsdl:part name="Body" element="tns:WeatherForecasts"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameHttpGetIn"&gt;
  &lt;wsdl:part name="PlaceName" type="s:string"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameHttpGetOut"&gt;
  &lt;wsdl:part name="Body" element="tns:WeatherForecasts"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeHttpPostIn"&gt;
  &lt;wsdl:part name="ZipCode" type="s:string"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByZipCodeHttpPostOut"&gt;
  &lt;wsdl:part name="Body" element="tns:WeatherForecasts"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameHttpPostIn"&gt;
  &lt;wsdl:part name="PlaceName" type="s:string"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="GetWeatherByPlaceNameHttpPostOut"&gt;
  &lt;wsdl:part name="Body" element="tns:WeatherForecasts"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="WeatherForecastSoap"&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a valid Zip Code(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByZipCodeSoapIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByZipCodeSoapOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a place name(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByPlaceNameSoapIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByPlaceNameSoapOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:portType name="WeatherForecastHttpGet"&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a valid Zip Code(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByZipCodeHttpGetIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByZipCodeHttpGetOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a place name(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByPlaceNameHttpGetIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByPlaceNameHttpGetOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:portType name="WeatherForecastHttpPost"&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a valid Zip Code(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByZipCodeHttpPostIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByZipCodeHttpPostOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for a place name(USA)
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:input message="tns:GetWeatherByPlaceNameHttpPostIn"/&gt;
  &lt;wsdl:output message="tns:GetWeatherByPlaceNameHttpPostOut"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name="WeatherForecastSoap" type="tns:WeatherForecastSoap"&gt;
  &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;soap:operation soapAction="http://www.webservicex.net/GetWeatherByZipCode" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;soap:operation soapAction="http://www.webservicex.net/GetWeatherByPlaceName" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:binding name="WeatherForecastSoap12" type="tns:WeatherForecastSoap"&gt;
  &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;soap12:operation soapAction="http://www.webservicex.net/GetWeatherByZipCode" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;soap12:operation soapAction="http://www.webservicex.net/GetWeatherByPlaceName" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:binding name="WeatherForecastHttpGet" type="tns:WeatherForecastHttpGet"&gt;
  &lt;http:binding verb="GET"/&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;http:operation location="/GetWeatherByZipCode"/&gt;
  &lt;wsdl:input&gt;
  &lt;http:urlEncoded/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;mime:mimeXml part="Body"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;http:operation location="/GetWeatherByPlaceName"/&gt;
  &lt;wsdl:input&gt;
  &lt;http:urlEncoded/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;mime:mimeXml part="Body"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:binding name="WeatherForecastHttpPost" type="tns:WeatherForecastHttpPost"&gt;
  &lt;http:binding verb="POST"/&gt;
  &lt;wsdl:operation name="GetWeatherByZipCode"&gt;
  &lt;http:operation location="/GetWeatherByZipCode"/&gt;
  &lt;wsdl:input&gt;
  &lt;mime:content type="application/x-www-form-urlencoded"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;mime:mimeXml part="Body"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;wsdl:operation name="GetWeatherByPlaceName"&gt;
  &lt;http:operation location="/GetWeatherByPlaceName"/&gt;
  &lt;wsdl:input&gt;
  &lt;mime:content type="application/x-www-form-urlencoded"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;mime:mimeXml part="Body"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name="WeatherForecast"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  Get one week weather forecast for valid zip code or Place name in USA
  &lt;/wsdl:documentation&gt;
  &lt;wsdl:port name="WeatherForecastSoap" binding="tns:WeatherForecastSoap"&gt;
  &lt;soap:address location="http://www.webservicex.net/WeatherForecast.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;wsdl:port name="WeatherForecastSoap12" binding="tns:WeatherForecastSoap12"&gt;
  &lt;soap12:address location="http://www.webservicex.net/WeatherForecast.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;wsdl:port name="WeatherForecastHttpGet" binding="tns:WeatherForecastHttpGet"&gt;
  &lt;http:address location="http://www.webservicex.net/WeatherForecast.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;wsdl:port name="WeatherForecastHttpPost" binding="tns:WeatherForecastHttpPost"&gt;
  &lt;http:address location="http://www.webservicex.net/WeatherForecast.asmx"/&gt;
  &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>I did not determine the difference between the two example
  and why in the first example the response is very slow</p>