1. Homepage
  2. Programming
  3. CO3102/CO7102 Mobile and Web Applications - Coursework 1 Web Data Interchange formats - XML and JSON

CO3102/CO7102 Mobile and Web Applications - Coursework 1 Web Data Interchange formats - XML and JSON

Engage in a Conversation
University of LeicesterCO3102CO7102Mobile and Web ApplicationsXMLJSONJava

CO3102/CO7102 Mobile and Web Applications Coursework 1 CourseNana.COM

Web Data Interchange formats - XML and JSON Important Dates: CourseNana.COM

Handed out: 3-Oct-2023 BST Deadline: 7-Nov-2023 at 16:59 GMT CourseNana.COM

Please ensure that you submit your work on time. CourseNana.COM

Use data-interchange formats (XML and JSON) and techniques appropriately to create documents and handle data. CourseNana.COM

Data Description
Consider an XML document (WebServiceInterface.xml): CourseNana.COM

<?xml version="1.0" encoding="UTF-8"?> <ServiceInterface name="IAuthService"> CourseNana.COM

<class>Remote</class> </superclass> CourseNana.COM

<include>java.rmi.Remote</include> <include>java.rmi.RemoteException</include> <include>java.io.*</include> <abstract_method id="authenticateUser"> CourseNana.COM

<access>public</access> <parameterList> CourseNana.COM

<parameter type="String">account</parameter> CourseNana.COM

<parameter type="String">password</parameter> </parameterList>
<exceptions>
CourseNana.COM

<throws>IOException</throws> CourseNana.COM

<throws>RemoteException</throws> </exceptions> <return>boolean</return> CourseNana.COM

</abstract_method> <abstract_method id="showMessage"> CourseNana.COM

<access>public</access> <parameterList> CourseNana.COM

<parameter type="String">message</parameter> </parameterList>
<return>void</return>
CourseNana.COM

</abstract_method> </ServiceInterface> CourseNana.COM

This XML document describes a Java interface below: CourseNana.COM

import java.rmi.Remote;
import java.rmi.RemoteException; import java.io.*; CourseNana.COM

interface IAuthService extends Remote{ CourseNana.COM

public boolean authenticateUser(String account, String password) throws IOException, RemoteException; CourseNana.COM

private void showMessage (String message); } CourseNana.COM

Tasks: CourseNana.COM

Task 1: [40 Marks] CourseNana.COM

Write an XML Schema (WebServiceInterface.xsd) to validate the provided XML document. Note that the schema defined must adhere to the following Java rules: CourseNana.COM

  • An interface may extend one or many interfaces. CourseNana.COM

  • There can be only one package statement * CourseNana.COM

  • There can be zero to many import statements CourseNana.COM

  • An interface can have zero to many abstract methods CourseNana.COM

  • A method only allows one value to be returned (or void) CourseNana.COM

  • A method can only have zero or one visibility modifier * CourseNana.COM

  • A method can accept zero to many arguments CourseNana.COM

  • Exception(s) may be thrown from a method CourseNana.COM

    * Note: If a method does not explicitly have a visibility modifier (e.g., “public”), it is accessible only within its own package (default visibility). This assume all methods are non-static. If the package statement is omitted, the class belongs to the “default” package. CourseNana.COM

    (Hint: refer to lab exercise – Week 1) Task 2: [30 Marks] CourseNana.COM

    Write an XSLT stylesheet (ServiceInterface.xslt) that takes the provided XML document as input and generates an HTML document as follows: CourseNana.COM

Note: You may show the result in a different page layout or colour scheme. (Hint: Lab Week 2/3) CourseNana.COM

Task 3: [30 Marks] CourseNana.COM

Write a program that extracts some information from the XML above and generates the JSON output as follows. Please choose an appropriate parsing technology. CourseNana.COM

{
"abstract_method": [{
CourseNana.COM

"method_name": "authenticateUser", "visibility": "public", "arguments": { CourseNana.COM

"parameter": [{
"datatype": "String",
CourseNana.COM

                     "label": "account"
                 },

{
"datatype": "String", "label": "password"
CourseNana.COM

} ] CourseNana.COM

          },
          "exceptions": {
              "exception": [
                 "IOException",

"RemoteException" ] CourseNana.COM

}, CourseNana.COM

"return": "boolean" }, CourseNana.COM

{
"method_name": "showMessage", "visibility": "public", "arguments": {
CourseNana.COM

"parameter": [{ "datatype": "String", CourseNana.COM

                 "label": "message"
              }]

}, CourseNana.COM

          "return": "void"
       }

] } CourseNana.COM

For Task 3, a Java template (WebServiceInterfaceParser.java) is provided, and you'll require xer- cesImpl.jar available on Blackboard. However, you can opt for alternative programming languages (e.g., Python, C++, C#, JavaScript, etc.) and parsers for this task. In such cases, please provide a README.txt file detailing the execution steps for your code. CourseNana.COM

It's important to note that the intentional formatting of the JSON output aims to prevent the use of pre-built XML to JSON functions from specific APIs. While you're free to choose parsers, the pars- ing technique's implementation must be in your code. For example, the program should generate the specified JSON output without including elements like "package," "import," etc. Furthermore, use of any built-in XML-to-JSON libraries for XML to JSON transformation (such as "toJSONObject" in Python etc), is not permitted. CourseNana.COM

CourseNana.COM

Submission CourseNana.COM

  • Zip all files in a single zip file for submission.
    o WebServiceInterface.xsd
    o WebServiceInterface.xslt
    o WebServiceInterface.java (or in your language of choice) CourseNana.COM

  • The archive should be named CO3102_CW1_email_id.zip or CO7102_CW1_email_id.zip (e.g. CO3102_CW1_yh37.zip). CourseNana.COM

    Your submission should also include a completed coursework plagiarism coversheet (print and signed PDF or image). You need to submit the zip file via Blackboard, and you are allowed to re- submit as many times as you like before the deadline. Marks for any coursework which does not have the accompanying cover sheet will be withheld till you provide one. CourseNana.COM

    Marking Scheme
    Note:
    In addition to the sample XML provided, additional XML documents will be included in the CourseNana.COM

    test suite. CourseNana.COM

    Part 1: XML Schema validity checking will be automated. In total, a test suite consisting of 12 XML documents will be used for the assessment. The marks will be distributed according to test results. CourseNana.COM

    Part 2: XSLT will be compiled and applied to 7 test cases (XML documents) for the assessment. All HTML pages will be checked by TA(s) manually. The marks will be distributed according to test results. CourseNana.COM

    Part 3: In total, 7 test cases (XML documents) will be used the assessment. Any JSON generated by your XML Parser will be checked by an JSON validator. The marks will be distributed accord- ing to test results. CourseNana.COM

    Anonymous marking CourseNana.COM

    We operate an anonymous marking scheme. All submitted files will be renamed using anonymous fingerprinting generated by SHA256.  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
University of Leicester代写,CO3102代写,CO7102代写,Mobile and Web Applications代写,XML代写,JSON代写,Java代写,University of Leicester代编,CO3102代编,CO7102代编,Mobile and Web Applications代编,XML代编,JSON代编,Java代编,University of Leicester代考,CO3102代考,CO7102代考,Mobile and Web Applications代考,XML代考,JSON代考,Java代考,University of Leicesterhelp,CO3102help,CO7102help,Mobile and Web Applicationshelp,XMLhelp,JSONhelp,Javahelp,University of Leicester作业代写,CO3102作业代写,CO7102作业代写,Mobile and Web Applications作业代写,XML作业代写,JSON作业代写,Java作业代写,University of Leicester编程代写,CO3102编程代写,CO7102编程代写,Mobile and Web Applications编程代写,XML编程代写,JSON编程代写,Java编程代写,University of Leicesterprogramming help,CO3102programming help,CO7102programming help,Mobile and Web Applicationsprogramming help,XMLprogramming help,JSONprogramming help,Javaprogramming help,University of Leicesterassignment help,CO3102assignment help,CO7102assignment help,Mobile and Web Applicationsassignment help,XMLassignment help,JSONassignment help,Javaassignment help,University of Leicestersolution,CO3102solution,CO7102solution,Mobile and Web Applicationssolution,XMLsolution,JSONsolution,Javasolution,