wiki:S2S_WEB_SERVICES_R0
Last modified 16 years ago Last modified on 12/20/08 16:59:09

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=S2S_WEB_SERVICES_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

Build web service API with the most appropriate technology for the requirements of the sophie 2 server. The services should be accessible from the client's connector.

Task requirements

  • choose the technologies to use for the web service implementation.
  • build the basic facade just for the user manipulation.
  • build web service providing user manipulation.

Task result

  • web service implementation accessible on the server.

Implementation idea

  • create dummyFacade that just calling some of the user service methods in org.sophie2.server.facade
  • use Servlets(REST) for now
  • try to post as result to the web service method calls XMLs, representing objects and data
  • for the generation of the XMLs think of the most appropriate technology to use(FreeMarker, Velocity, ObjectToXML generators like JAXB and others)

S2S_CORE_SECURITY_R0
S2S_PERSISTENCE_COMMONS_R0

How to demo

Make request to the url that the implemented web service is listening and see the result.

Design

The class diagram :
source:/trunk/sophie2-platform/modules/org.sophie2.server/doc/S2S_WEB_SERVICES_R0.jpg

  • The XMLManagementService is used to convert AbstractEntity and basic types to XML result. It uses the Velocity template engine (for details).
  • For now the UserManager and it's server side implementation are basic Facade, which uses directly the Core's UserService methods.
  • The UserWebService is HttpServlet that acts like an REST web service. It receives GET parameters on it's url, the first is the name of the method to call, and the others it's arguments. UserWebService invokes the UserManager server implementation methods and returns the results in the form of an XML documents by it's response using the XMLManagmentService.
  • For the first revision there will be no escaping of invalid XML characters and security logic like encoding/decoding of passwords and mail addresses.
  • For the first revision the facade will be simple but in the future the web services will grant access to the whole Facade
  • The XML converting of AbstractEntities containing references to other AbstractEntities will be implemented at later revision.
  • XMLManagementService will be able to convert Strings, booleans and integers for now.
  • The result XML that the web services will post will be with root tag "result".
  • The UserWebServices will be able to invoke the three methods of the UserManager interface:
    • If the GET data is in the format ?method=login&userbame=some_user_name&password=some_pass will be executed the login method of the UserManager interface with the passed parameters.
    • If the GET data is in the format ?method=getUserGroups&userId=some_user_id will be executed the getUserGroups method of the UserManager interface with parameter user with id the passed one.
    • If the GET data is in the format ?method=userExists&username=some_user_name will be invoked the userExists method of the UserManager interface with parameter the passed username.

Here are the tests for the generation of the XML :
trunk/sophie2-platform/modules/org.sophie2.server/src/test/java/org/sophie2/server/service/XMLManagementServiceTest.java

Implementation

The implementation is in 961, 974 and 975

Testing

Comments

(Write comments for this or later revisions here.)