Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
                                 LIBRARY USE 
 
LA TROBE UNIVERSITY 
 
SEMESTER TWO EXAMINATION PERIOD 
 
2011 
 
 
  Student ID:                Seat Number:     
 
 
 Unit Code: CSE3WS    Paper No: P1 
                                                                                                               
  Unit Name:          Web Services                                                                                                                                  
 
  Paper Name:  Final Examination 2011 
 
  Reading Time: 15 minutes 
 
  Writing Time: 3 hours 
 
  No. of Pages (including cover sheet): 10 
    
 
OFFICE USE ONLY (FACULTY/SCHOOL STAFF):  
CAMPUS                AW                BE                BU                MI                
SH                
 
ALLOWABLE MATERIALS 
 
Number Description 
92 Students may make notes during reading time (not on script books or multiple choice answer sheets). 
 
 
 
 
INSTRUCTIONS TO CANDIDATES 
 
  1.  This paper contains five (5) questions. Candidates should attempt all questions. 
  2.  Marks for this paper total 100. 
  3.  All questions have equal marks 
  4.  Seventy percent (70%) of the final assessment for this subject will be based on this examination 
paper. 
 
 
This paper MAY NOT BE REMOVED from the examination venue 
Question 1 – XML Syntax and Basics 
 
(a) Describe briefly what it means to say that an XML document is well formed and valid. 
(b) Rewrite and correct the syntax errors for the following xml document: 
 1  
 2  
 3  Local weather observations 
 4      
 5      
 6     Wepple North 
 7     36.03 
 8     140.00  
 9      
 10     
 11     
 12         
 13             
 14             9.3  
 15            18.5 
 16                           
 17             
 18         
 19             
 20            12.2 
 21            23.7 
 22            12  
 23     
 24     
 25  
 
(c) Expand the acronyms URL and URN, and briefly describe what they are used for in XML. 
(d) XML documents may contain processing instructions, elements and attributes. 
(i) What are processing instructions used for? 
(ii) What is the difference between an element and an attribute? 
 
(e) Create a suitable XML document (XML only – a DTD not required) to store data for the 
following problem 
 
An XML document is required to hold details for all members in a tennis club. 
The following information is required for each member of the club: 
 name, date of birth, phone number and 
 next of kin details (name and phone number). 
 Membership type – full, concession or life membership. 
 Role (one of president, secretary, treasurer or ordinary member). 
 The number of games won and games lost. 
 
Choose suitable names for the elements involved, and ensure that at least one piece of 
information is encoded as an attribute. 
 
 
      (2 + 6 + 4 + 2 + 6 = 20 Marks) 
Web Services (CSE3WS) Final Examination, Semester 2, 2011 
Page 3 of 10 
 
Question 2 – DTDs, Schema and Validation 
 
(a) Consider the following Document Type Description (DTD) and use it to answer the questions in 
this question sub-section: 
 
 1  
 2  
 3  
 5  
 6  
 7  
 8  
 9  
10  
11           
12  
13  
18  
 
(i)  What is the meaning of the ? character in line 4? 
(ii)  What is the meaning of the comma ' , ' character between the names given in line 4? 
(iii)  What is the meaning of the #IMPLIED keyword in the line 15? 
(iv)  What values can the status attribute of vehicle take? 
(v)  If the status attribute is omitted in the XML document what will the XML parser do? 
 
 
Web Services (CSE3WS) Final Examination, Semester 2, 2011 
Page 4 of 10 
(b) The DTD from part (a) has been converted to the following XML Schema. Examine it carefully 
and use it to answer this question sub-section.     
 
     
     
                     
                 
             
     
     
         
             
             
             
             
             
             
             
             
                 
         
             
                 
                     
                     
                     
                 
             
         
     
     
         
             
         
     
     
         
         
         
         
     
 
This question continues on the next page… 
Web Services (CSE3WS) Final Examination, Semester 2, 2011 
Page 5 of 10 
 
Question 2 – DTDs, Schema and Validation part b (continued) 
 
(i) What is the purpose of the attribute,  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
in the schema element declaration?  
(ii) Identify the element declaration and the specific attributes that allow an element to occur 
multiple times. 
(iii) What is the effect of setting default="new" in the element declaration for vehicle attribute 
"status"?  
(iv) The above Schema is used to validate the following XML instance document and multiple 
errors are reported. Identify those errors and explain why they have occurred.   
 
  1  
 2  
 3  
 6  
 7  
 8      
 9         abc-596-P 
10         2007 
11         Toyota 
12         Camry 
13         225034.6 
14          
16         Good condition 
17      
18      
19         A-M-3-Z 
20         2010 
21         Holden 
22         Commodore 
23         7130 
24      
25  
 
 
 ( (2 + 2 + 2 + 1+ 1) + (2 + 2 +  2 + 6) = 20 Marks) 
Web Services (CSE3WS) Final Examination, Semester 2, 2011 
Page 6 of 10 
Question 3 – XPath and XSLT 
 
(a)  Consider the following XML and XSLT documents: 
 
XML file (airports.xml) XSLT file (airports.xsl) 
 
 
 
 
 
 
     
        Bendigo 
        YBDG 
        36.74 
        144.33 
        705 
     
 
     
        Birdsville 
        YBDV 
        25.897 
        139.348 
        157 
     
 
     
        Canberra 
        YSCB 
        35.306 
        149.195 
        1886 
     
 
     
        Sydney INTL 
        YSSY 
        33.947 
        151.177 
        21 
     
 
  
 
 
 
 
     
 
     
 
         
             
                Airport Report 
             
 
             
              
             
total =
Latitude: S Longitude: E
(i) Show the html code that would result from applying the given XSLT stylesheet (airports.xsl) to the XML document airports.xml. (ii) Show the changes to the XSLT file so that it generates output for airports whose elevation (elev element) is numerically less than 500, by displaying the name of the airport and its airport code value. DO NOT write out the entire XSL file, just supply the changes and additions to the code. (iii) Using XSLT elements code a template to produce a list of airport names for airport elements that have the international attribute set to "true". This question continues on the next page… Web Services (CSE3WS) Final Examination, Semester 2, 2011 Page 7 of 10 Question 3 – XPath and XSLT cont… (b) For the following Xpath expressions explain in your own words the meaning of the xpath expression and its parts and their effect: (i) "//booking[ number(substring(start,1,2)) > 9)]" (ii) "//booking[ start='09:00:00' or (schedule/day='Mon' and @type='lab') ]" (c) For the following XML instance document draw its tree structure showing the element nodes only. BGO32WP Web Programming Wed 17:00:00 BUS228 BGO21JP Java Programming Mon 11:00:00 BUS111 ((4 + 4 + 4) + (3 + 3) + 2 = 20 Marks) Web Services (CSE3WS) Final Examination, Semester 2, 2011 Page 8 of 10 Question 4 – XML Technologies and Web Services (a) Describe what is meant by "Web Services" by providing a brief technical definition for Web Services, that is, identify the major XML based technologies which implement Web Services and briefly explain their role. (b) In order to consume a Web Service, what pieces of information about the service does the client need to know to use the service and where are they published? (c) Briefly outline the structure of a SOAP envelope and identify what each part is used for. (d) Explain how XML Schema is used to solve the problem of exchanging data between different applications written in different programming languages and running on different computer platforms. (e) Clearly describe at least two (2) major differences between the way that DOM-based parsers and SAX-based parsers are implemented in JAXB. (f) The “name” element is used for two purposes in the following XML code fragment. Rewrite the code to use name spaces to differentiate between the “name” elements. Your answer must demonstrate how to map name space prefixes to unique name spaces. joe smith
joe@ironbark.com.au
54441234 Introduction to Java Programming Web Services XML Basics
(3 + 4 + 3 + 3 + 2 + 5 = 20 Marks) Web Services (CSE3WS) Final Examination, Semester 2, 2011 Page 9 of 10 Question 5 – Web Service XML Technologies This question refers to a Schema given below and a WSDL document on the following page. Please study both carefully before attempting your answer to this question. (a) For the Schema document webservices.xsd (i) Describe the relationship of the defined elements to each other (give both names and types). (ii) Is it mandatory for the errormessage element to be present? (b) For the WSDL document webservices.wsdl (i) Briefly explain the purpose of each child (sub-element) of the root element (ii) How is the Schema incorporated into this document and what is its purpose? (iii) What is the name of the Web Service defined by this WSDL document? (iv) Which transport protocol is used by this Web Service? (v) What messaging protocol is used by this Web Service? (vi) What is the URI for the access point to this Web Service? (vii) Identify the method(s), their parameter(s) (give both names and types) and return type. (viii) Briefly explain the purpose of webservices.xsd This question continues on the next page… Web Services (CSE3WS) Final Examination, Semester 2, 2011 Page 10 of 10 Question 5 – Web Service XML Technologies cont… webservices.wsdl ( (2 + 2) + (5 + 2 + 1 + 1 + 1 + 2 + 2 + 2) = 20 Marks)