Hi.
I'm an "old school" developer, so you may take this response as a joke. Simply by changing the flow of the page guided by a request parameter, you can write client HTML code in one flow, and in other flow call the WS by the request parameter argumented in that call. For example, suppose this is your JSP page (test.jsp) :
...
<![CDATA[<%
if (request.getParameter("yesWeCan") != null){
try {
webservice.CalculatorService service = new webservice.CalculatorService();
webservice.Calculator port = service.getCalculatorPort();
int nodeType = 0;
java.lang.String result = port.treeList(nodeType);
} catch (Exception ex) {
}
}
%>
...
and from your Javascript you've goto to call JSP page like this :
http://.../test.jsp?yesWeCan=true
Furthermore, when parameter "yesWeCan" is not null, you don't need to write any HTML code to the client, so you can call this in an asynchronous way using Ajax, for example.
Hope this helps.
Regards.