blob: bb0263c781964b74d35dc27d09565ad18bb6b86e [file] [log] [blame]
<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><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.<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-&gt;New -&gt; 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">
</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">
</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"> 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"></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">
</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"> <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"><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"><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"><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-&gt;New-&gt;XML-&gt;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"><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"></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"></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"><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"><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-&gt;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-&gt;New-&gt;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 -&gt; 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-&gt;Preferences-&gt;Web and XML-&gt;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"></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>
</body>
</html>