|
From: <mba...@us...> - 2006-08-08 07:00:31
|
Revision: 1553 Author: mbarchfe Date: 2006-08-08 00:00:22 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1553&view=rev Log Message: ----------- designker patch: Restored Welcome page, moved cheatsheet actions from rdt.debug.ui to rdt Added Paths: ----------- trunk/org.rubypeople.rdt/cheatsheets/ trunk/org.rubypeople.rdt/cheatsheets/Sample.wsdl trunk/org.rubypeople.rdt/cheatsheets/WebServices.xml Added: trunk/org.rubypeople.rdt/cheatsheets/Sample.wsdl =================================================================== --- trunk/org.rubypeople.rdt/cheatsheets/Sample.wsdl (rev 0) +++ trunk/org.rubypeople.rdt/cheatsheets/Sample.wsdl 2006-08-08 07:00:22 UTC (rev 1553) @@ -0,0 +1,64 @@ +<?xml version="1.0"?> + +<definitions name="webServiceExample" + targetNamespace="http://www.rubypeople.org/xmlns/webServiceExample" + xmlns:tns="http://www.rubypeople.org/xmlns/webServiceExample" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:apachesoap="http://xml.apache.org/xml-soap"> + + <types> + <schema + xmlns="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://www.rubypeople.org/xmlns/webServiceExample"> + + <complexType name="User"> + <all> + <element name="id" type="xsd:int"/> + <element name="name" type="string"/> + </all> + </complexType> + + + </schema> + </types> + + <message name="msg_user_request"> + <part name="user" type="tns:User"/> + </message> + + <message name="msg_user_response"> + <part name="return" type="xsd:int"/> + </message> + + <portType name="webServiceExamplePortType"> + <operation name="addUser"> + <input message="tns:msg_user_request"/> + <output message="tns:msg_user_response"/> + </operation> + </portType> + + <binding name="webServiceExampleServicePortBinding" type="tns:webServiceExamplePortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + + <operation name="addUser"> + <soap:operation soapAction=""/> + <input> + <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.rubypeople.org/xmlns/webServiceExample/"/> + </input> + <output> + <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.rubypeople.org/xmlns/webServiceExample/"/> + </output> + </operation> + </binding> + + <service name="webServiceExampleService"> + <port name="webServiceExamplePort" binding="tns:webServiceExampleServicePortBinding"> + <soap:address location="http://localhost/webServiceExampleService"/> + </port> + </service> + +</definitions> \ No newline at end of file Added: trunk/org.rubypeople.rdt/cheatsheets/WebServices.xml =================================================================== --- trunk/org.rubypeople.rdt/cheatsheets/WebServices.xml (rev 0) +++ trunk/org.rubypeople.rdt/cheatsheets/WebServices.xml 2006-08-08 07:00:22 UTC (rev 1553) @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<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"> + <!-- Fix missing class + <action pluginId="org.rubypeople.rdt.debug.ui" + class="org.rubypeople.rdt.internal.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" param1="soap4r" + class="org.rubypeople.rdt.internal.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" param1="MyWebservice" + class="org.rubypeople.rdt.internal.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" param1="MyWebservice" + class="org.rubypeople.rdt.internal.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" + param1="/cheatsheets/Sample.wsdl" param2="/MyWebservice/sample.wsdl" + class="org.rubypeople.rdt.internal.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" + class="org.rubypeople.rdt.internal.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" + class="org.rubypeople.rdt.internal.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" + class="org.rubypeople.rdt.internal.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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |