I am using following approaches to create web service client. I could likte to know if connection between client and server is established after creating stub instance like followings.
Otherwise Is connection between client and server established after invoking Remote method calling such as stub.xxxmethod()
, myervicePort.xxxMetho()
RPC/Encoded
stub = new MyWsRPCPortStub(new URL(), new MyWsRPCLocator());
stub.setTimeout(pdbTimeout);
Document/Literal
MyServicePort myervicePort = service.getMyServicePort();
After learning the above question I am going to decide when stub instance will be created? I mean there will be two ways:
1- create only one stub instance in application ,I mean I will use singleton pattern
2- create stub instance before invoking a method call each time
What if I use only one stub instance with multithread appiication, each thread open difference sockets at the same time while invoking stub.xxMethod()
At the same time T1->stub.xxMethod() T2->stub.xxMethod() T3->stub.xxMethod()