Oracle APEX 4.2发布RESTful Webservice

本教程详细介绍了如何在Oracle APEX 4.2中创建RESTful Web Service,包括在Application Express中建立服务引用,并使用Java客户端消费这些服务。内容涵盖数据库访问、OEHR样本对象、Java SDK安装,以及RESTful服务的创建、引用和消费步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Purpose

    This tutorial covers creating a RESTful Web Service and accessing the Web Service through an application in Application Express 4.2. This tutorial also covers consuming the Web Service using a Java client.

    Time to Complete

    Approximately 40 minutes

    Introduction

    Web Services enable applications to interact with one another over the web in a platform-neutral, language independent environment. In a typical Web Services scenario, a business application sends a request to a service at a given URL by using the protocol over HTTP. The service receives the request, processes it, and returns a response. Web Services are typically based on Simple Object Access Protocol (SOAP) or Representational State Transfer (REST) architectures. RESTful Web Services are result oriented. The scope of the Web Service is found in the URI and the method of the service is described by the HTTP method that is used such as GETPOSTPUT, and DELETE.

    This tutorial covers creating a RESTful Web Service declaratively using Oracle Application Express's SQL Workshop tool, and then consuming the same service by creating an application and adding a Web Service Reference to the RESTful Web Service. The RESTful Web Service is also consumed using a Java client.

    Prerequisites

    Before starting this tutorial, you should have:

 

Creating a RESTful Web Service

  1. In this topic, you create a RESTful Web Service using RESTful Services tool in SQL Workshop. The RESTful Web Service Wizard is a set of pages in SQL Workshop that help you to create a RESTful Web Service declaratively. The RESTful Web Service calls a specific SQL statement in your database.

    Log into the Application Express Login page using your login credentials. Enter the following credentials and click Login

    Note: Here, the Workspace, Username and Password used are obe.

    Workspace: OBE
    Username: OBE
    Password: obe


    Click SQL Workshop.

    Select RESTful Services.

    Click Create to create a RESTful Service.

    Enter Employees as the Name for the RESTful Service module. Enter the URI Template as employees to identify your Uniform Resource Identifier (URI). Select GET as the method. Select CSV for Format. This identifies the HTTP method to be used for the Resource Handler. For Source, enter the following SQL query. This is responsible for handling the selected HTTP method. Click Create Module.

    select * from oehr_employees

    Click the GET method Resource Handler.

    Change the Require Secure Access option from Yes to No. Click Apply Changes.

    Click Test to test the behavior of the RESTful Service Handler.

    You are prompted to save the file which you can then view using a CSV editor. The CSV format resultset is displayed. Make a note of the URI which is used later while creating a client service.



    Click Create Handler to create a Resource Handler

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值