Question: Data Description Consider an XML document ( WebServiceProvider . xml ) : uk . ac . le . cs . CO 3 1 0 2
Data Description
Consider an XML document WebServiceProviderxml:
ukaclecsCO
Remote
java.rmi.Remote
java.rmi.RemoteException
java.net.
public
account
password
url
RemoteException
MalformedURLException
boolean
private
user
void
This XML document describes a Java interface below:
package ukaclecsC;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.net.;
interface RESTInterface extends Remote
public boolean authenticateUserString account, String password, URL url
throws RemoteException, MalformedURLException;
private void deleteUser String user;
Task : Marks
Write a program that extracts some information from the XML above and generates the JSON output as follows. Please choose an appropriate parsing technology.
"abstractmethod":
"method name": "authenticateUser",
"visibility": "public",
"arguments":
"parameter":
"datatype": "String",
"label": "account"
"datatype": "String",
"label": "password"
"datatype": "URL",
"label": "url"
"exceptions":
"exception":
"RemoteException",
"MalformedURLException"
"return": "boolean"
"methodname": "deleteUser",
"visibility": "private",
"arguments":
"parameter":
"datatype": "String",
"label": "user"
"return": "void"
For Task a Java template WebServiceParserjava is provided, and you'll require xercesImpl.jar available on Blackboard. However, you can opt for alternative programming languages eg 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.
It's important to note that the intentional formatting of the JSON output aims to prevent the use of prebuilt XML to JSON functions from specific APIs. While you're free to choose parsers, the parsing 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 builtin XMLtoJSON libraries for XML to JSON transformation such as "toJSONObject" in Python etc is not permitted.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
