wiki:Client/Development/ClientStub

Generating the client stub (Java)

To use our web service you first need to create a stub out of the WSDL file, which describes the interface you must use to access JPlag. With the provided framework this is a very easy task: Just open a shell, go into the "jplagTutorial" folder and type the following:

ant generate-client

This will create a set of Java files in a "jplagClient" subfolder needed to use the web service using the WSDL file on our web server.

Especially JPlagTyp_Stub provides the following web service functions to clients:

Method

Description

getServerInfo()

Description: Returns some user account informations, the available languages including default values for suffixes and minimum match length, the available country languages and a list of own submissions on the server.

Parameters: none

Returns: A ServerInfo? object

compareSource(Option, MimeMultipart?)

Description: Quickchecks the parameters and adds the given submission to the working queue.

Parameters: An Option object setting the submission parameters (see Sending a submission for details) and a MimeMultipart? object containing a ZIP file with all the files to be compared in the structure specified by the Option object.

Returns: A submission identification string

Note: MimeMultipart? is not supported by .NET, so use startSubmissionUpload and continueSubmissionUpload instead for .NET.

startSubmissionUpload(StartSubmissionUploadParams?)

Description: Quickchecks the parameters and starts taking a submission upload with the first 80 kB part of the submission ZIP file. If the submission file size is less than or equal to 80 kB, the submission is added to the working queue. The part size may not be less than 80 kB, if there is more than one part to be sent.

Parameters: A StartSubmissionUploadParams? object containing an Option object and the first 80 kB part of the submission ZIP file as a byte array

Returns: A submission identification string

continueSubmissionUpload(byte [])

Description: Used to send the next 80 kB part to the server. If the remaining file size is less than or equal to 80 kB, the submission is added to the working queue. The part size may not be less than 80 kB, if this part is not the last part to be sent.

Parameters: A byte array containing the next 80 kB part

Returns: A dummy integer which can be ignored

getStatus(String)

Description: Returns the current state and progress of the submission identified by the submissionID

Parameters: A submission identification string

Returns: A Status object (see Waiting for a result for details)

getResult(String)

Description: Returns the result ZIP file of the requested submission in a MimeMultipart? object.

Parameters: A submission identification string

Returns: A MimeMultipart? object containing the result ZIP file

Note: You have to call cancelSubmission afterwards to delete the files from the server.

Note: MimeMultipart? is not supported by .NET, so use startResultDownload and continueResultDownload instead for .NET.

startResultDownload(String)

Description: Starts the download of the requested submission and returns the total size of the result ZIP file and its first 80 kB part. If it is the only part of the download, the file is deleted from the server afterwards.

Parameters: A submission identification string

Returns: A StartResultDownloadData? object containing the file size and the first 80 kB part of the file as a byte array

continueResultDownload(int)

Description: Returns the next 80 kB part of the current download. If it is the last part of the download, the size might be less than 80 kB and the file is deleted from the server.

Parameters: A dummy integer, which should be zero.

Returns: A byte array containing the next 80 kB part

cancelSubmission(String)

Description: Cancels the specified submission and removes all related files from the server.

Parameters: A submission identfication string

Returns: A dummy integer which can be ignored

updateUserInfo(UpdateUserInfoParams?)

Description: Allows the user to change his password, update his alternative email address and his homepage. A null value means, that the value should remain unchanged. An empty string removes the attribute. The password must have at least 6 characters.

Parameters: An UpdateUserInfoParams? object

Returns: A dummy integer which can be ignored

Next: Contacting the server

Last modified 5 years ago Last modified on Dec 7, 2012 11:26:15 AM