MilanDemo

Prep:

  • RestPluginDownloads
  • Create sample Customer Database project (from samples template )
  • Open The CustomerResource.java.
  1. Drag and Drop the Address Verification 40 service into this java src file.
  2. On the dialog that comes up.. enter the userid/password

a.userid: sundemo@strikeiron.com
b. password: sundemo07

  1. Click OK on the dialog.
  • Create a Persistence Unit
  • Create sample Customer Database Client project.
  • Use this client project to update the customer ID 1's address to have a valid data. This way we can show the US address verification service from Strikeiron working properly
  1. Deploy the Customer Database project
  2. Run the Customer Database Client project. This will display the database entries. Select the ID of the first entry and edit the address to a real address.
  • Restart appserver.((Needed because we have classcast exception in the latest GF build which was fixed in the previous build :-( ))

Demo:

Overview:
- The demo will show creation, testing, consumption story for RESTful web services.
- The demo will also talk about consuming partner services.

1. Creation: Bring up customerdb.service.CustomerResource.java
Tallking points:
Here I have a web project that support dev, test deploy of RESTful web services. The RESTful webservice implementation in NB is based on JSR 311 Java API. This JSR defines annotation on the java file that translates the POJO to be accessed by Web 2.0 clients as URI based resources.

The RESTful web services are created based on specific patterns which the developers use as best practices to create these type of services. Here in this project I have created the services based on a container-containee pattern which letc me translate the DB entities into URI based accessible resources.

(( Here you can show the New action on the project which shows the RESTful web services actions. They are
RESTful web services from entity classes
RESTful web services from patterns
))
I used the RESTful web services from entity classes to create the services in this project. BTW we have some sample integrated which are also documented in the tutorials to get started with this.

2: Partner Services & Test:
Go back to IDE and open CustomerResource.java if it is not opened. Drag AddressVerification 40 to CustomerResource.java (this may take a few seconds). Click OK on the dialog that comes up. ((Note: dont have to enter the values in the dialog this time as it is a bit tedious)).
Talking points:
- Mention value add for showcasing partner services. Show the services tab and the web services node which has the Strikeiron services populated. Mention that these services can be consumed across IDE for visual web app creastion, orchestration of services in SOA tooling etc. This demo will focus on consuming this from RESTful services. The benefit of that is that these services(which are SOAP/WSDL based) are now easily exposed to the client apps as simple URIs. We have essentially created little REST wrapper services that invoke these value added services under the hood. People doing Web 2.0 client programming will appreciate this :-)
- The US Address verification service will be tied with the customer's address that comes from the DB and will invoke the Strikeiron service with the customer's address from the DB. Lets demonstrate that.
- Now we are ready to deploy the service.
2.a. Select the Test Restful web services menu in the project. After a few seconds, the Test client is displayed on the browser.
Talking points: - Test client is generated for inspecting and navigating the generated resources and testing CRUD on them.
- REST Resources are at the left hand side (point to customers)
2.b. Select the customers link.
Talking points:
- Point out the various HTTP methods that are tested.
2.c. Click on the Test button for GET on customers.
Talking points:
- Display the tabular view. Showcase that the data from the DB is retrieved and shown here.
2.d.Click on the first customer and click Test
2.e. Select the usAddressVerification link and click Test. ((Note: There will also be a usaAddressVerification1 link.. pls ignore that.))
2.f. Result is displayed in Test output. ((Show the fact that the result comes back as VALID))

3. Consumption: Run the Customer database client project
Talking points:
- I have created the client project that showcases consuming the RESTful web services I just created.
- This project again is an integrated sample in the IDE.
- The idea of client support is to facilitate the RIA developer to interface with these services easily using some high level wrapper APIs to minimize the tedious Ajax type code they have to write to invoke one of these.
- This project as you can see shows you an interface that is close to how a real client would use the customer DB. There is support to do all CRUD type functionality that we did in the test client in a easier way using this client support.
(( Maybe you can point out the Add/Delete type functionlity on the customer and show clicking a customer ID that the GET is invoked ))

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo