URL url = new URL(WOApplication.application().directConnectURL() +
"/ws/StatefulAction?wsdl");
StatefulActionImplService service = new StatefulActionImplService(url,
new QName("http://ws.erjaxws.examples.er/", "StatefulActionImplService"));
StatefulAction sAction = service.getPort(StatefulAction.class);
/* setting this property is essential for enabling stateful mode in our client proxy
* after setting this, session cookies will be passed to the server on subsequent
* requests */
((BindingProvider) sAction).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
sAction.authenticate("name", "password");
serverOutput = sAction.testAction("test");
return null;
}