summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib/very-old-samples/helloworld-rest/README
blob: 00568d9bb03a8eecc422f0ee71688078bd206f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Hello World REST Sample
=======================

Sample Overview
---------------
The service 'HelloWorldService' is exposed using the REST binding.

helloworld-jsonrpc-webapp/
  src/
    main/
      java/
        helloworldjsonrpc/
          HelloWorldService.java      - service interface
          HelloWorldServiceImpl.java  - service implementation
          ClientTestServiceWebapp.java - Test class; uses java.net.HttpURLConnection to make 'GET', 'PUT', 'POST requests
      resources/
        rest.composite             - the SCA assembly for this sample
      webapp
        META-INF/
          sca-contribution.xml        - specifies the composite to be deployed
        WEB-INF/
          web.xml                     - defines the listener that starts up the 
                                        Tuscany SCA runtime     
  pom.xml                             - the Maven build file  

Build the sample using Maven.
A war 'helloworld-rest-webapp.war' will be created in the target directory. Deploy it in your web container.
You can access the service from the browser by making a simple GET request using the following URL:
http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname

Use the test class 'ClientTestServiceWebapp' to test PUT, POST operations.