Sandy Ghosh wrote:Hi Nilesh, did you get any solution of this problem?? I am stuck in the same issue.. Please help..
Note: Kindly don't use eclipse based Web Service client tools.
1. download the apache cxf from
http://cxf.apache.org/download.html
2. Set path variable for apache cxf.
3. open command prompt and go to your the wsdl file location.
4. run the following command to generate the client code for web service.
wsdl2java -frontend jaxws21 CalculatorWS.wsdl
above command generate the java client code for apache cxf based web service.
Use the generated client code in your project for writing web service client.
Below i have metioned how instantiate port and set the session property
public CalculatorWS port;
Service service = Service.create(new URL(""http://localhost:8080/CalculatorWS?wsdl"), new QName("http://apache.org/cxf/calculator", "CalculatorService");
port = service.getPort(new QName("http://apache.org/cxf/calculator", "CalculatorPort");, CalculatorWS.class);
((BindingProvider)Helper.port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
((BindingProvider)port).getRequestContext().put("javax.xml.ws.client.connectionTimeout","18000000"); //60*1000*60*5 =5 hours
((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "3600000"); //30*1000*60 - 30 minute - Duration Defines Web Service Response Time