JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator
It isn't supposed to matter to a web service what platform or programming language it's dealing with. When Sun Java Studio Creator first appeared in beta two years ago, it apparently was not fully compatible with Visual Studio. Now that both languages have changed, it is possible to create a JSP web client in one of them for a simple web service created in the other. This article explains how.
JSP Consumer for a Visual Studio Created Web Service Using Sun Java Studio Creator - JSP Client Returning Result from the Web Service (Page 5 of 6 )
In this section you will add a few standard controls to the JSP. You will also drag and drop the web service component whose return value will be displayed by the JSP, and write the necessary code to bind the returned value to the controls. When you drag and drop components the Java code gets modified to reflect the components added, so that in the code you will have access to the methods, properties and events.
Add standard controls
Bring up the TestHello.jsp page in the design mode. From the Palette add a Button and a TextBox as shown.
Drag and drop the Web Service Component
From the Web Services node in the Servers window drag and drop the the service called Service (this is why you need to change default names). Service has two methods, HelloWorld() and Curtime(), both returning a string value. With this the Java code changes to reflect these additional objects. This also changes the JSP page content, as shown by the following window, by adding the serviceClient1 object.
Write code to the button's click action
When you click the button, the Java page opens, allowing you to enter your code to the button1_action(). Java Studio Creator makes it very easy to insert exception handling code by providing a canned snippet which can be accessed from the window named Code Clips shown in the next picture. You can drag and drop the code onto the tabbed page Java at the point where you want to insert the snippet.
Now inside the try block you will be writing the code to bind the textbox's textField1 (similar to the text property of a textbox in Microsoft) by calling the setValue() method. This value is the one returned by the service's Curtime() method (which happens to be a string) as shown in the next paragraph.
You do get coding help displaying methods and properties after you choose an object as shown in the next window, but it does take a finite amount of time and is not instantaneous (have patience).