| <html> |
| <head> |
| <meta |
| http-equiv="Content-Type" |
| content="text/html; charset=Cp1252"> |
| <meta |
| http-equiv="Content-Style-Type" |
| content="text/css"> |
| <link |
| href="../theme/Master.css" |
| rel="stylesheet" |
| type="text/css"> |
| <title>Getting Started.html</title> |
| </head> |
| <body> |
| <h1>XML Tools Evaluation Guide</h1> |
| <h2>1.0 Introduction</h2> |
| <p>The XML Tools contribution consists of the following components</p> |
| <ul> |
| <li><a href="#3.1">XML example wizards</a></li> |
| <li><a href="#3.2">XML Schema editor</a></li> |
| <li><a href="#3.3">WSDL editor and 'New WSDL' wizard'</a></li> |
| <li><a href="#3.4">Validators for various XML artifacts</a> |
| <ul> |
| <li>XML</li> |
| <li>XML Schema</li> |
| <li>DTD</li> |
| <li>WSDL with optional WS-I validation*</li> |
| </ul> |
| </li> |
| <li><a href="#3.5">New XML wizard and XML generators </a></li> |
| <li><a href="#3.6">XML catalog support</a></li> |
| </ul> |
| <p>* These components are pulled in from the eclipse WSVT project</p> |
| <h2>2.0 Getting Started</h2> |
| <p>The easiest way to get started using the XML tools is to use the New Example wizard to create the example |
| 'Editing and Validating XML files' project. This wizard will create a 'simple' project and populate it with some XML |
| artifacts that you can use to experiment with the editors and validators. See section 3.1 for more details. Although the |
| XML tools are designed to work in various perspectives, we'll choose to use the resource perspective to explore the |
| tools.</p> |
| <h2>3.0 Quick Tour</h2> |
| <h3><a name="3.1">3.1 XML example wizards</a></h3> |
| <p>The XML Example wizard is a very simple component that provides a sample project that is pre-populated with some |
| example files. From the main menu select File->New -> Example to invoke the dialog shown below. Currently there is |
| only one example project named 'Editing and validating XML files'. This sample project is a handy way to populate your |
| workspace with some XML files so that you can try out the XML Tools.<br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/New_Example.gif" |
| width="501" |
| height="429" |
| alt=""></p> |
| <h3><a name="3.2">3.2 XML Schema editor</a></h3> |
| <p>Under the PurchaseOrder folder, locate the PurchaseOrder.xsd file and double click the file to open it in the XML |
| Schema Editor. As shown below, an Outline and Properties view is provided in addition to the editor pane. At the bottom |
| of the editor area you'll see that there is a 'Source' and a 'Graph' tab at the bottom of the editor area. The 'Source' |
| tab is used for basic XML source editing. The 'Graph' tab is used for higher level graphical editing. Select the 'Graph' |
| tab so that you're looking at the Graph view. As shown below you should see a 'top level' view of the XML Schema that |
| summarizes all of the components (e.g. elements and types) that are defined in the schema.<br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/XSD_Editor_top_level_view.gif" |
| width="867" |
| height="718" |
| alt=""></p> |
| <p>In order to see these components in detail you can 'drill down' on a component of interest by double clicking on |
| it. For example, if we double click on the 'purchaseOrder' component, the editor will display the structure of the |
| 'purchaseOrder' element as shown below. Notice that the +/- controls can be used to navigate into an element's |
| containment structure. To return to the 'top level' view, press the back button <img |
| border="0" |
| src="XMLToolsEval_files/XSD_Editor_back.gif" |
| width="26" |
| height="21" |
| alt=""> at the top left of the editor, or right clicking within the editor and selecting 'Back to Schema' from |
| the context menu.<br> |
| </p> |
| <p><img |
| border="0" |
| src="XMLToolsEval_files/XSD_Editor_purchaseOrder.gif" |
| width="587" |
| height="475" |
| alt=""></p> |
| <p>Editing the schema is acheived by invoking context menu actions on selected objects in the Graph view and using |
| the properties view to modify the properties of the selected object. Follow the steps below to create a new element |
| declaration and define its content.</p> |
| <ol> |
| <li>right click within the 'Elements' section of the top level schema and choose 'Add Global Element'</li> |
| <li>use the properties view to change the name of the element to 'purchaseOrderList' <img |
| border="0" |
| src="XMLToolsEval_files/XSD_Editor_properties.gif" |
| width="516" |
| height="178" |
| alt=""></li> |
| <li>right click within the 'Elements' section of the top level schema and choose 'Add Global Element'</li> |
| <li>use the properties view to change the name of the element to 'purchaseOrderList'</li> |
| <li>now double click on the element in the editor to drill down on the element so that we can edit its |
| structure</li> |
| <li>right click on the purchaseOrderList and select 'Add Sequence' to specify that the element will contain a |
| sequence of child elements.<br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/XSDEditor_purchaseOrderList.gif" |
| width="377" |
| height="136" |
| align="top" |
| alt=""> <br> |
| </li> |
| <li>right click on the sequence to specify a child element, in this case we want to reference an existing |
| element so we'll add an element reference as shown below.<br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/XSDEditor_addElementRef.gif" |
| width="384" |
| height="179" |
| align="top" |
| alt=""><br> |
| </li> |
| <li>Notice that editor automatically selected the 'PurchaseOrderElement' (as shown below). Luckily this happens |
| to be the element we'd like to reference. If we wanted to specify a different element we could click on the label to |
| invoke a combo box to select an alternative element. In the properties view modify the element reference's minOccurs |
| and maxOccurs to be 0 and undbounded respectively. This specifies that the purchaseOrderList element will contain |
| zero or more purchaseOrder elements.<img |
| border="0" |
| src="XMLToolsEval_files/XSDSchema_minmax.gif" |
| width="441" |
| height="119" |
| alt=""><br /> |
| </li> |
| <li>Right click again on the sequence node and add an element. Rename NewElement to retailerInfo. Now in the |
| properties view, switch to the 'Attributes' tab so that we can define some attributes for the retailerInfo element. |
| Right click in the empty box on the left to add attribute use the table on the right to name the attribute |
| 'retailerName' with a type of 'string'. Add another attribute and give it the name 'dateSubmitted' and give it the |
| type 'date'. Your editor should appear as shown below. <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/XSDEditor_attributes.gif" |
| width="755" |
| height="498" |
| alt=""><br /> |
| </li> |
| <li>Now that we've finished editing the XML Schema you can save the file. If you'd like to validate the schema |
| or create an XML instance from the schema continue to sections 3.4 and 3.5 for more details.</li> |
| </ol> |
| <h3><a name="3.3">3.3 WSDL Editor and 'New WSDL' wizard</a></h3> |
| <p>In this section we will explore the new WSDL wizard and WSDL Editor by creating a completely new WSDL file. The |
| WSDL file we will be creating is TemperatureService.wsdl. We will go through adding Operations, deleting Operations, |
| generating our binding, and simple editing using the editor.</p> |
| 1. New WSDL Wizard |
| <ul> |
| <li>From the main menu, select File->New->XML->WSDL to launch the New WSDL Wizard.</li> |
| <li>Select a project and enter the filename "TemperatureService.wsdl". Click Next.</li> |
| <li>In the next dialog, there is a "Create WSDL Skeleton" checkbox. This option is used to create a skeleton |
| (sample) WSDL file. This allows the user the ability to quickly modify and edit this skeleton for their own |
| purposes. Select this checkbox and the SOAP rpc encoded option and click Finish. <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/WSDLEditor_NewWSDLWizard.jpg" |
| align="top" |
| alt=""><br> |
| <br> |
| </li> |
| </ul> |
| 2. Exploring and editing the newly created WSDL file |
| <ul> |
| <li>The newly created WSDL file will open in the editor. Explore the WSDL using the Graph view ("Graph" tab), |
| Source view ("Source" tab), outline view, and the properties view.</li> |
| <li>In the Graph View, rename the Port under the "TemperatureService" Service to "GetTemperatureInfoSOAP".</li> |
| <li>Rename the Port Type to "GetTemperatureInfoSOAP".</li> |
| <li>Rename the Operation to "GetTemperatureForZipCode". The rename will rename the Operation and it's |
| associated elements. For example, it will rename the Operation, Messages, Parts, and Elements.The rename will only |
| rename associated elements if the name of the element is a generated name. For instance, if the Message |
| "NewOperationRequest" was renamed to "NewMessageName" before the Operation rename was done, the Message will not be |
| renamed.</li> |
| <li>Rename the Message "GetTemperatureForZipCodeRequest" to "GetTemperatureInput". Notice the Part is also |
| renamed because the Part is a generated name.</li> |
| <li>Rename the Part "GetTemperatureInput" to "ZipCode".</li> |
| <li>Rename the Part "GetTemperatureForZipCodeResponse" to "Temperature".</li> |
| <li>Rename the Message "GetTemperatureForZipCodeResponse" to "GetTemperatureOutput". Notice the Part is not |
| renamed.</li> |
| <li>Select the Part "Temperature" and change the type to "xsd:float" using the properties view.<br> |
| <br> |
| </li> |
| </ul> |
| 3. Adding a new Operation |
| <ul> |
| <li>Right click on the PortType "GetTemperatureInfoSOAP" and select "Add Operation". The Add Operation Dialog |
| will appear with a "Create default messages" checkbox. Selecting this checkbox will create two default Messages. One |
| for Input and one for Output. If this checkbox is not selected, only an Input and Output will be created.</li> |
| <li>Create the Operation with this option selected and the filename "GetTemperatureForDate". <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/WSDLEditor_AddOperationDialog.jpg" |
| align="top" |
| alt=""></li> |
| <li>Rename the Message "GetTemperatureForDateRequest" to "GetTemperatureForDateInput".</li> |
| <li>Rename the Part "GetTemperatureforDateInput" to "Date".</li> |
| <li>Rename the Message "GetTemperatureForDateResponse to "GetTemperatureForDateOutput".</li> |
| <li>Rename the Part "GetTemperatureForDateOutput" to "Temperature".</li> |
| <li>Select the Part "Date" and change the type to "xsd:date" using the properties view.</li> |
| <li>Select the Part "Temperature" and change the type from "xsd:string" to "xsd:float" by right-clicking on the |
| Part and selecting "Set Type..."<br> |
| <br> |
| </li> |
| </ul> |
| 4. Adding an Operation by copying an existing Operation |
| <ul> |
| <li>Copy the "Operation by right-clicking on the Operation "GetTemperatureForZipCode" and select "Copy".</li> |
| <li>Right-click on the Operation again and select "Paste".</li> |
| <li>A copy of "GetTemperatureForZipCode" is created with the name "GetTemperatureForZipCode1". Notice the |
| Input, Output, Messages, and Parts are also copied.</li> |
| <li>Rename the Operation "GetTemperatureForZipCode1" to "GetTemperatureForCity".</li> |
| <li>Rename the Message "GetTemperatureInput1" to "GetTemperatureForCityInput"</li> |
| <li>Rename the Part "ZipCode" to "City".</li> |
| <li>Select the Part "City" and change the type to "xsd:string".</li> |
| <li>Rename the Message "GetTemperatureForCityResponse" to "GetTemperatureForCityOutput".<br> |
| <br> |
| </li> |
| </ul> |
| 5. Editing an 'embedded' schema |
| <ul> |
| <li>Select the Part "City" and in the properties view, change the "Reference Kind" to "element".</li> |
| <li>In the Graph view, select the Part "City", do a right-click, and select "Set Element...". A dialog will |
| appear with an option to create a new element. Select this option and use the element name "City". Click "Finish"</li> |
| <li>In the top right of the Graph View, the newly created type will appear (currently there is a small bug. |
| Only the arrow and the schema icon appears at this point. However, the targetnamespace should also appear). Double |
| clicking on the arrow will open the 'embedded' schema editor. From here, the user can edit as if it were the XML |
| Schema editor. <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/WSDLEditor_EmbeddedSchemaEditor.jpg" |
| align="top" |
| alt=""></li> |
| <li>Click on the "Back to Previous view" button located on the top left corner of the editor to move back to |
| the WSDL view.<br> |
| <br> |
| </li> |
| </ul> |
| 6. Deleting an Operation |
| <ul> |
| <li>Right-click on the Operation "GetTemperatureForCity" and select "Delete".</li> |
| <li>A dialog will appear with a "Delete associated Messages and Parts". Having this checkbox selected will |
| delete the Operation's associated Messages and Parts only if the Messages are not referenced by other Operations.</li> |
| <li>Select this option and Click "Ok". <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/WSDLEditor_DeleteOperationDialog.jpg" |
| align="top" |
| alt=""><br> |
| <br> |
| </li> |
| </ul> |
| 7. Regenerate Binding |
| <ul> |
| <li>Right-click on the Binding "NewWSDLFileSOAP" and select "Generate Binding Content...".</li> |
| <li>Select the "Overwrite existing binding information" and click "Finish". Notice there is now a Binding |
| Operation for each Operation. <br> |
| <img |
| border="0" |
| src="XMLToolsEval_files/WSDLEditor_GenerateBindingDialog.jpg" |
| align="top" |
| alt=""><br> |
| <br> |
| </li> |
| </ul> |
| 8. Now that we've finished editing the WSDL you can save the file. If you'd like to validate the WSDL continue to |
| section 3.4 |
| <h3><a name="3.4">3.4 Validators for XML artifacts</a></h3> |
| <p>There are several ways to inoke the validators. The most direct way is to right click on a file (for example |
| purchaseOrder.xsd) and select 'Validate XML Schema' from the context menu. A dialog message will pop up to inform you if |
| the file is valid or not. If the file is invalid errors will be shown in the Problems view. Using the project's |
| preferences, you can also configure the validators to be invoked automatically when a resource is saved. With this |
| setting enabled the validator is automatically invoked and the Problems view is updated when a file is saved. In order |
| to validate an entire project right click on the project and select 'Run Validation'.</p> |
| <h3><a name="3.5">3.5 New XML wizard and XML generators</a></h3> |
| <p>The capability to create an XML instance from a DTD or XML Schema is provided via a 'Generate->XML' menu |
| option and via a 'New XML File' Wizard. Follow the steps below to generate an XML file from an XML Schema. The 'New |
| Wizard' dialog works bery much the same but is invoked from the File->New->Other menu action.<br> |
| </p> |
| <ol> |
| <li>In the naviagor view, select the file PurchaseOrder.xsd under the PurchaseOrder directory</li> |
| <li>Right click on the file and select 'Generate -> XML File...'</li> |
| <li>Accept the default name PurchaseOrder1.xml, press Next</li> |
| <li>In the 'Root Element' combo select the 'PurchaseOrder' (or 'PurchaseOrderList' element if you've completed |
| section 3.2).</li> |
| <li>Check the the 'Create Optional elements' box, press Finish</li> |
| <li>The XML file will now open up in the XML Editor. Notice that the file's content has been generated |
| according to the structure defined in the XML Schema.</li> |
| </ol> |
| <h3><a name="3.6">3.6 XML catalog</a> support</h3> |
| <p>The XML Catalog provides a way to redirect references to XML artifacts (specified by URI locations and namespace |
| names) to an alternate location. Typically this mechanism is used to redirect remote refereces to resources out on the |
| web to a local copy. The user can manually edit the XML Catalog entries via the preferences page (select |
| Window->Preferences->Web and XML->XML Catalog. By pressing the 'New..' button the user can populat the 'User |
| Specified Entries' section of the catalog with a new catalog entry.</p> |
| <h3><img |
| border="0" |
| src="XMLToolsEval_files/XMLCatalog.gif" |
| width="503" |
| height="358" |
| alt=""></h3> |
| <p>You'll notice that the 'Plugin Specified Entries' section of the catalog contains a lot of entries. These entries |
| are contributed by serverl plugins via extension point defined in plugin.xml files. Generally if a plugins requires |
| access to an XML resources that is officially available on the web it will ship a local copy of that XML resource and |
| contribute a catalog entry to redirect remote references to the local copy.</p> |
| <h2>4.0 Provide Feedback to Us</h2> |
| <p>We encourage development/design feed back on the <a href="https://dev.eclipse.org/mailman/listinfo/wtp-dev">wtp-dev</a> |
| mailing list. You can subscribe to the list via <a href="https://dev.eclipse.org/mailman/listinfo/wtp-dev">this link</a>.<br> |
| <br> |
| For usage questions, discussion of bugs, and strange behaviour please post to the eclipse.webtools newsgroup. |
| Information on the Web Tools Platform newsgroup can be found <a href="http://www.eclipse.org/newsgroups/index.html">here</a>.</p> |
| <p></p> |
| </body> |
| </html> |