I'm making changes to some java applications and i'm noticing they instantiate the service client in every iteration of the loops, like this:
for(String name : names) {
HelloService helloWS = new HelloService();
HellowServicePort helloPort = helloWS.getHelloServicePort();
helloPort.sayHello(name);
}
Instead of getting the port once, like this:
HelloService helloWS = new HelloService();
HellowServicePort helloPort = helloWS.getHelloServicePort();
for(String name : names) {
helloPort.sayHello(name);
}
Does using the second approach make any difference?