|
From: Markus B. <mba...@us...> - 2005-09-17 21:45:28
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/cheatsheets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7643/cheatsheets Modified Files: WebServices.xml Log Message: updated and enhanced with Index: WebServices.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/cheatsheets/WebServices.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WebServices.xml 2 Dec 2004 21:20:51 -0000 1.6 --- WebServices.xml 17 Sep 2005 21:45:18 -0000 1.7 *************** *** 2,160 **** <cheatsheet title="Using RDT"> <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"> ! <description> This cheat sheet is an introduction to the Ruby Development Tools (RDT) and ! uses a real world scenario to show how the RDT can be leveraged in your work with ruby. ! As a prerequiste you need to get and install soap4r 1.5.2. Although it is included ! since ruby 1.8.1, you will need it because of the wsdl2ruby.rb file, which is not part ! of ruby 1.8.1 or later. To start working on this cheat sheet, click the "Click to ! Begin" button below. </description> </intro> ! <item href="/org.rubypeople.rdt.doc.user/html/ch01.html" title="Interpreter setup"> ! <description> Make sure you have registered at least one ruby interpreter with RDT. Click ! on the help button if you don't know how to do that. </description> </item> ! <item ! href="/org.rubypeople.rdt.doc.user/html/ch02s02.html" ! title="Switch to Ruby Perspective"> ! <action ! pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRubyPerspectiveAction"/> ! <description> Use the "Click to Perform" button to open the ruby perspective. ! This can also be done manually by choosing "Window->Open ! Perspective->Other..." from the main menu and selecting "Ruby" from ! the dialog which opens. ! </description> ! </item> <item title="Create Ruby project on soap4r"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="soap4r" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenNewRubyProjectWizardAction"/> ! <description> In order to run wsdl2ruby.rb from the soap4r package, you create a ruby ! project called soap4r on top of the soap4r installation directory at first. After ! clicking the "Click to Perform" button below, the "New Ruby ! Project" wizard will open. The project name "soap4r" is already entered. ! Disable the "Use Default" checkbox in the project content area and use the ! browse button to select the directory to which you have unzipped the soap4r tar ball. ! </description> </item> <item title="Create MyWebservice project"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="MyWebservice" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenNewRubyProjectWizardAction"/> ! <description> In this step you create a new project within your workspace, which will be ! used to hold the wsdl file and the generated code from this file. The project is called ! "MyWebservice" The "Click to Perform" button opens the "New ! Ruby Project" wizard again. This time you can leave the "Use Default" ! checkbox enabled. This will create the project as a subdirectory into your workspace ! location. </description> </item> <item title="Add wsdl file to MyWebservice"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="MyWebservice" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.CreateWsdlFileAction"/> ! <description> Add a new file called sample.wsdl to the MyWebservice project. In the dialog ! which "Click to Perform" brings up you only have to enter the file name ! "sample.wsdl". The MyWebservice project is already selected as the container ! of this new resource. </description> </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch02s03.html" title="Add content to sample.wsdl"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="/cheatsheets/Sample.wsdl" ! param2="/MyWebservice/sample.wsdl" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.CopyContentAction"/> ! <description> In the last step you have created the file "sample.wsdl". But why ! is it not there? It is, but is filtered out: In the Ruby Resources views menu deselect ! "Show Ruby Files only" (this can be found by clicking the down arrow in the ! Ruby Resources view MenuBar, in the menu of options). The "Click to Perform" ! buttons copies sample content to the wsdl file. The content is copied from the ! Sample.wsdl file which ships with RDT. </description> </item> ! <item title="Run wsdl2ruby.rb" href="/org.rubypeople.rdt.doc.user/html/ch02s07.html"> ! <description> Open the soap4r project. Open the bin directory and right-click the ! "wsdl2ruby.rb" file to open the context menu. Choose "Run->Run Ruby ! Application". Check the console for the output of the process. There you find the ! required command line options. </description> </item> ! <item title="Modify the run configuration for server generation" ! href="/org.rubypeople.rdt.doc.user/html/ch02s07.html"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> "Click to Perform" opens the run configuration dialog, which is ! also available as Run->Run... from the main menu. The running of wsdl2ruby.rb in the ! last step has created a run-configuration named "wsdl2ruby.rb". Rename it to ! "wsdl-gen-server" Now open the Arguments tab and add "--wsdl sample.wsdl ! --type server" to the program arguments. Then you change the working directory to ! the directory of the MyWebservice project. Therefore you must know where your workspace ! resides on the local disk: If you have forgotten which workspace you are using or where ! it resides, you can choose "File->Switch Workspace". </description> </item> <item title="Check generated server files"> ! <description> The execution of the last step should have generated three files. Because ! they have been created on the file system from the outside, you must execute ! "Refresh" from the context menu of the MyWebservice project. Then you should ! see the new files: webServiceExample.rb, webServiceExampleServant.rb and ! webServiceExampleService.rb. If they are not there or are empty, check the console for ! error messages. If there is a stack trace in the console, you can double-click to open ! the specified file locations. </description> </item> ! <item title="Create Run-Configuration for client generation" ! href="/org.rubypeople.rdt.doc.user/html/ch02s07.html"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> "Click to Perform" opens the run configuration dialog again. ! Perform "Duplicate" from the context menu of the wsdl-gen-server run ! configuration. A duplicate "wsdl-gen-server (1)" will be generated. Rename it ! to "wsdl-gen-client", change the argument "--type server" to "--type client" and click "Run". </description> </item> - <item title="A Note on Run-Configurations" - href="/org.rubypeople.rdt.doc.user/html/ch02s07.html"> - <description> At this point you have created two run-configurations for the wsdl2ruby.rb - file: wsdl-gen-server and wsdl-gen-client. These configurations will be stored in your - workspace and therefore survive restarts of eclipse. You can start them via - "Run->Run History" from the main menu or from the run configuration dialog - opened with "Run->Run...". But because there is more than one - Run-Configuation for the same file, the context menu "Run Ruby Application" - of wsdl2ruby.rb and the "Run->Run As->Ruby Application" from the main menu - are now without function. Although they are still enabled, choosing them does nothing. - This was just an information, use the "Click to Complete" button to proceed. - </description> - </item> <item title="Check generated client files"> ! <description> Click "Refresh" on the MyWebservice project to display the two ! newly generated files: webServiceExampleDriver.rb and webServiceExampleServiceClient.rb. </description> </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch02s08.html" title="Check ruby version"> ! <description> Please note there are limitations in the ruby versions which are suitable for ! debugging. On Linux there is a restriction to ruby 1.6, on windows ruby 1.8.2 works ! fine but 1.8.1 does not. See help for more details. If your version of ruby ! does not meet these requirements, use "Run->Run Ruby Application" instead of ! "Debug->Debug Ruby Application" in the next step for starting the server. ! </description> ! </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch02s08.html" title="Debug server"> ! <description> Open the editor for ! webServiceExampleServant.rb (by double-clicking it in the "Ruby Resources" ! view) and set a breakpoint in the line which raises the NotImplementedError. A ! breakpoint can be set and removed either by double-clicking on the vertical bar at the ! left side of the editor or by using the context menu on that bar. Start the debugger ! with "Debug->Debug Ruby Application" from the context menu of ! webServiceExampleService.rb. ! </description> </item> ! <item title="Run client" href="/org.rubypeople.rdt.doc.user/html/ch02s07.html"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> Use the "Click to perform" button or select "Run->Run..." ! from the main menu to open the run configuration dialog. Select "Ruby ! Application" and click "New". Rename the newly created run configuration ! to "run-client" Select webServiceExampleServiceClient.rb as the file to be ! run with the "Browse" button. Go the Arguments Tab and add ! "http://localhost:10080/" as program argument. Click Run. </description> </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch02s08.html" title="Breakpoint hit"> ! <description> After a while the clients request will trigger the breakpoint in the server ! process. If you haven't debugged before, you will be asked whether to switch to the ! debug perspective or not. You should confirm the switch. In the debug perspective you ! can see where the server process halted and examine the programs state. E.g. you can ! see that the user variable is nil. Being at the end of this sheet you hopefully know ! enough about RDT to modify the client to deliver a useful user object to the server... </description> </item> </cheatsheet> \ No newline at end of file --- 2,190 ---- <cheatsheet title="Using RDT"> <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm"> ! <description> This cheat sheet is an introduction to the Ruby Development Tools ! (RDT) and uses a real world scenario to show how the RDT can be leveraged in your ! work with ruby. As a prerequiste you need to get and install soap4r 1.5.5: extract ! soap4r-1_5_5.tar.gz and run install.rb. Although soap4r is included since ! ruby 1.8.1, you will need it because of the wsdl2ruby.rb file, which is not part of ! ruby 1.8.1 or later. Extract so To start working on this cheat sheet, click the ! "Click to Begin" button below. </description> </intro> ! <item href="/org.rubypeople.rdt.doc.user/html/ch02.html#importantSettings" ! title="Interpreter setup"> ! <description> Make sure you have registered at least one ruby interpreter with RDT. ! Click on the help button if you don't know how to do that. </description> </item> ! <item title="Switch to Ruby Perspective"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRubyPerspectiveAction"/> ! <description> Use the "Click to Perform" button to open the ruby ! perspective. This can also be done manually by choosing "Window->Open ! Perspective->Other..." from the main menu and selecting ! "Ruby" from the dialog which opens. </description> ! </item> <item title="Create Ruby project on soap4r"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="soap4r" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenNewRubyProjectWizardAction"/> ! <description> In order to run wsdl2ruby.rb from the soap4r package, you create a ruby ! project called soap4r on top of the soap4r installation directory at first. ! After clicking the "Click to Perform" button below, the "New ! Ruby Project" wizard will open. The project name "soap4r" is ! already entered. Disable the "Use Default" checkbox in the project ! content area and use the browse button to select the directory to which you have ! unzipped the soap4r tar ball. </description> </item> <item title="Create MyWebservice project"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="MyWebservice" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenNewRubyProjectWizardAction"/> ! <description> In this step you create a new project within your workspace, which will ! be used to hold the wsdl file and the generated code from this file. The project is ! called ! "MyWebservice" The "Click to Perform" button opens the ! "New Ruby Project" wizard again. This time you can leave the ! "Use Default" checkbox enabled. This will create the project as a ! subdirectory into your workspace location. </description> </item> <item title="Add wsdl file to MyWebservice"> ! <action pluginId="org.rubypeople.rdt.debug.ui" param1="MyWebservice" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.CreateWsdlFileAction"/> ! <description> Add a new file called sample.wsdl to the MyWebservice project. In the ! dialog which "Click to Perform" brings up you only have to enter the ! file name ! "sample.wsdl". The MyWebservice project is already selected as the ! container of this new resource. </description> </item> ! <item title="Add content to sample.wsdl"> ! <action pluginId="org.rubypeople.rdt.debug.ui" ! param1="/cheatsheets/Sample.wsdl" param2="/MyWebservice/sample.wsdl" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.CopyContentAction"/> ! <description> In the last step you have created the file "sample.wsdl". ! But why is it not there? It is, but is filtered out: In the Ruby Resources views menu ! deselect ! "Show Ruby Files only" (this can be found by clicking the down arrow in ! the Ruby Resources view MenuBar, in the menu of options). The "Click to ! Perform" buttons copies sample content to the wsdl file. The content is ! copied from the Sample.wsdl file which ships with RDT. </description> </item> ! <item title="Run wsdl2ruby.rb" ! href="/org.rubypeople.rdt.doc.user/html/ch03s10.html"> ! <description> Open the soap4r project. Open the bin directory and right-click the ! "wsdl2ruby.rb" file to open the context menu. Choose ! "Run->Run Ruby Application". Check the console for the output of the ! process. There you find the required command line options. </description> </item> ! <item title="Modify the run configuration for server generation"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> "Click to Perform" opens the run configuration dialog, ! which is also available as Run As->Run... from the main menu. The running of ! wsdl2ruby.rb in the last step has created a run-configuration named ! "wsdl2ruby.rb". Rename it to ! "wsdl-gen-server" Now open the Arguments tab and add "--wsdl ! sample.wsdl --type server" to the program arguments. Then you change the ! working directory to the directory of the MyWebservice project. Therefore you ! must know where your workspace resides on the local disk: If you have forgotten ! which workspace you are using or where it resides, you can choose ! "File->Switch Workspace". </description> </item> <item title="Check generated server files"> ! <description> The execution of the last step should have generated three files. ! Because they have been created on the file system from the outside, you must ! execute ! "Refresh" from the context menu of the MyWebservice project. Then ! you should see the new files: webServiceExample.rb, ! webServiceExampleServant.rb and webServiceExampleService.rb. If they are ! not there or are empty, check the console for error messages. If there is a stack ! trace in the console, you can double-click to open the specified file locations. ! </description> </item> ! <item title="Create Run-Configuration for client generation"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> "Click to Perform" opens the run configuration dialog ! again. Perform "Duplicate" from the context menu of the ! wsdl-gen-server run configuration. A duplicate "wsdl-gen-server ! (1)" will be generated. Rename it to "wsdl-gen-client", ! change the argument "--type server" to "--type client" and click "Run". </description> </item> <item title="Check generated client files"> ! <description> Click "Refresh" on the MyWebservice project to display ! the two newly generated files: webServiceExampleDriver.rb and webServiceExampleServiceClient.rb. </description> </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch03s12.html#DebugKnownLimitations" ! title="Check ruby version"> ! <description> Please note there are limitations in the ruby versions which are ! suitable for debugging. On Linux there is a restriction to ruby 1.6, on windows ! ruby 1.8.2 works fine but 1.8.1 does not. See Help->Help Contents for more ! details. If your version of ruby does not meet these requirements, use ! "Run->Run Ruby Application" instead of ! "Debug->Debug Ruby Application" in the next step for starting the ! server. </description> </item> ! <item title="Debug server"> ! <description> Open the editor for webServiceExampleServant.rb (by ! double-clicking it in the "Ruby Resources" view) and set a ! breakpoint in the line which raises the NotImplementedError. A breakpoint can ! be set and removed either by double-clicking on the vertical bar at the left side ! of the editor or by using the context menu on that bar. Start the debugger with ! "Debug->Debug Ruby Application" from the context menu of ! webServiceExampleService.rb. </description> ! </item> ! <item title="Modify the client"> ! <description> If you look at the client code in webServiceExampleServiceClient.rb ! you will notice that the user variable is set to nil. Assign a new user object ! instead, e.b. with User.new('myID', 'myName'). Save the editor with the icon ! from the toolbar or ctrl+s.</description> ! </item> ! <item title="Run the client"> ! <action pluginId="org.rubypeople.rdt.debug.ui" class="org.rubypeople.rdt.internal.debug.ui.cheatsheets.webservice.OpenRunConfigurationAction"/> ! <description> Use the "Click to perform" button or select ! "Run->Run..." from the main menu to open the run configuration ! dialog. Select "Ruby Application" and click "New". ! Rename the newly created run configuration to "run-client". Select ! webServiceExampleServiceClient.rb as the file to be run with the ! "Browse" button. Go the Arguments Tab and add ! "http://localhost:10080/" as program argument. Click Run. ! </description> </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch03s12.html#startDebugSession" ! title="Breakpoint hit"> ! <description> After a while the clients request will trigger the breakpoint in the ! server process. If you haven't debugged before, you will be asked whether to ! switch to the debug perspective or not. You should confirm the switch. In the ! debug perspective you can see where the server process halted and examine the ! program state. E.g. in the Variables view you can see the attribute values of ! the user object. </description> ! </item> ! <item title="Edit the server code"> ! <description>If you have a look at ! the wsdl file, you'll discover that the addUser method expects an integer as return ! value. Therefore you can replace the raise command with "return 0" and ! save the new code. When you save the code the ruby interpreter, which runs the ! server, also reloads the code. Now resume the server with the resume button, ! "Run->Resume" or F8.</description> ! </item> ! <item href="/org.rubypeople.rdt.doc.user/html/ch03s12.html#codeReload" ! title="Check the output of the client"> ! <description> In the Debug view you can see that the client has terminated. In order to ! see its output, select the terminated process. After that the Console shows the ! output of the client, which is a stack trace showing the NotImplementedError: ! although the interpreter has reloaded the new content of ! webServiceExampleServant.rb it finished the stack with the old code. ! Therefore we must run the client again.</description> ! </item> ! <item title="Run the client again"> ! <description> Now run the client again with "Run->Run ! History->run-client", wait for the breakpoint and resume again. The ! console displays 0, the result of the addUser method, instead of the stack trace. </description> </item> + <item title="End"> + <description> This tutorial has given you a short overview of RDT. Please mind that + RDT is an an open source project and needs the feedback and contributions + from the users. Please visit http://www.rubypeople.org/ if you want to help to + further improve RDT.</description> + </item> </cheatsheet> \ No newline at end of file |