19
<Insert Picture Here> Practical Uses for Web Services in Application Express

Practical Uses for Web Services in Application Express

  • Upload
    katy

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Practical Uses for Web Services in Application Express. - PowerPoint PPT Presentation

Citation preview

Page 1: Practical Uses for Web Services in Application Express

<Insert Picture Here>

Practical Uses for Web Services in Application Express

Page 2: Practical Uses for Web Services in Application Express

2© 2012 Oracle Corporation – Proprietary and Confidential

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remain at the sole discretion of Oracle.

Page 3: Practical Uses for Web Services in Application Express

3© 2012 Oracle Corporation – Proprietary and Confidential

<Insert Picture Here>

Agenda

• Web services introduction

• Web service support in Application Express

• Amazon S3

• APEX_WEB_SERVICE API

• Web Service Tools and Debugging

• Additional resources

• Q & A

Page 4: Practical Uses for Web Services in Application Express

4© 2012 Oracle Corporation – Proprietary and Confidential

<Insert Picture Here>

“Web services are typically application programming interfaces (API) or web APIs that are accessed via

Hypertext Transfer Protocol and executed on a remote system hosting the requested services. Web services tend

to fall into one of two camps: Big Web Services and

RESTful Web Services.”

Web Services Definitionhttp://en.wikipedia.org/wiki/Web_service

Page 5: Practical Uses for Web Services in Application Express

5© 2012 Oracle Corporation – Proprietary and Confidential

SOAP Web Services

Page 6: Practical Uses for Web Services in Application Express

6© 2012 Oracle Corporation – Proprietary and Confidential

RESTful Style Web Services

Page 7: Practical Uses for Web Services in Application Express

7© 2012 Oracle Corporation – Proprietary and Confidential

RESTful Style Web Services

• REpresentational State Transfer• RESTful Web service request

– HTTP Method (GET, PUT, POST, DELETE, HEAD) indicates method of the service

– HTTP URI (path) indicates the resource– HTTP headers– HTTP entity-body (parameter name/value pairs)

• RESTful Web service response– XML– Text– JSON

Page 8: Practical Uses for Web Services in Application Express

8© 2012 Oracle Corporation – Proprietary and Confidential

RESTful Support Application Express 4.x

• Expose report regions as RESTful Web service• Wizard to create RESTful Web reference– NEW in 4.1: Testing interface while creating the reference

• Test/Edit RESTful Web reference• Wizard to create form on RESTful Web reference• Wizard to create form and report on RESTful Web

reference• NEW in 4.2: Support for JSON responses

Page 9: Practical Uses for Web Services in Application Express

9© 2012 Oracle Corporation – Proprietary and Confidential

Amazon Simple Storage Service (S3)

• Storage for the Internet– Designed to provide 99.99999999% durability and 99.99%

availability– Designed to sustain the concurrent loss of data in two facilites

• Write, read, delete objects from 1 byte to 5 terabytes• Objects are stored in “buckets” – a container for objects• Common use cases:– Content storage and distribution– Backup or disaster recovery

Page 10: Practical Uses for Web Services in Application Express

10© 2012 Oracle Corporation – Proprietary and Confidential

Amazon S3 – Technical Details

• Create an AWS account, http://aws.amazon.com/• Sign up for an S3 account, http://aws.amazon.com/s3• Authentication– Authorization HTTP header• AWS AWSAccessKeyId:Signature• Signature is HMAC-SHA1 of selected elements from the

request, AWS Secret Key is used for the key

• Uses REST or SOAP interfaces

Page 11: Practical Uses for Web Services in Application Express

11© 2012 Oracle Corporation – Proprietary and Confidential

Amazon S3 – Technical Details

• Endpoint: http(s)://s3.amazonaws.com• Common HTTP Headers for all interactions– Host: <bucket_name>.s3.amazonaws.com– Date: Convert to GMT, and then use format Dy, DD Mon

YYYY HH24:MI:SS GMT– Authorization: AWS <AWSAccessKeyId>:<Signature>

Page 12: Practical Uses for Web Services in Application Express

12© 2012 Oracle Corporation – Proprietary and Confidential

Amazon S3 – Technical Details – Common Operations

• List All Buckets• Create Bucket• Delete Bucket• List Bucket Contents• Get Object• Add Object• Delete Object

Page 13: Practical Uses for Web Services in Application Express

13© 2012 Oracle Corporation – Proprietary and Confidential

apex_web_service API

• Allows you to interact with Web services (SOAP, REST, RPC) in Application Express anywhere you can write PL/SQL• Includes functions to encode/decode binary data

to/from base64 encoding• Contains function to parse response based on an

XPath expression• Globals to retrieve/set HTTP Headers and cookies

Page 14: Practical Uses for Web Services in Application Express

14© 2012 Oracle Corporation – Proprietary and Confidential

APEX_WEB_SERVICEMAKE_REST_REQUEST Function - Syntax

APEX_WEB_SERVICE.MAKE_REST_REQUEST(

p_url IN VARCHAR2,

p_http_method IN VARCHAR2,

p_username IN VARCHAR2 default null,

p_password IN VARCHAR2 default null,

p_proxy_override IN VARCHAR2 default null,

p_body IN CLOB default empty_clob(),

p_body_blob IN BLOB default empty_blob(),

p_parm_name IN WWV_FLOW_GLOBAL.VC_ARR2 default empty_vc_arr,

p_parm_value IN WWV_FLOW_GLOBAL.VC_ARR2 default empty_vc_arr,

p_wallet_path IN VARCHAR2 default null,

p_wallet_pwd IN VARCHAR2 default null ) RETURN CLOB;

Page 15: Practical Uses for Web Services in Application Express

15© 2012 Oracle Corporation – Proprietary and Confidential

Netflix API

• JavaScript, REST, Atom feeds– search content– manage subscriber queue– display subscriber’s ratings– auto-complete

• Response is POX (plain old XML)• Register for key and secret– http://developer.netflix.com/apps/register/

• OAuth for authentication dealing with subscriber information• Most requests are signed (much like Amazon s3)

Page 16: Practical Uses for Web Services in Application Express

16© 2012 Oracle Corporation – Proprietary and Confidential

Web Service Tools and Debugging

• Web Service Reference testing interface• Altova XMLSpy– Good for inspecting response– Has utility to give you XPath to response nodes

• ProxyTrace, http://www.pocketsoap.com/tcptrace/pt.aspx– Allows you to inspect the exact HTTP traffic (including headers) for a

web service request/response– Set proxy of your client to go through ProxyTrace to inspect the

traffic

Page 17: Practical Uses for Web Services in Application Express

17© 2012 Oracle Corporation – Proprietary and Confidential

Additional Resources

• Application Express on OTN: http://otn.oracle.com/apex• Application Express Web Service Integration Page:

http://www.oracle.com/technetwork/developer-tools/apex/application-express/integration-086636.html– Application Express 4.0 Web Services Evaluation Guide– Web Service Integration Sample Applications– Web Service Integration Whitepapers

• Blog: http://jastraub.blogspot.com

Page 18: Practical Uses for Web Services in Application Express

18© 2012 Oracle Corporation – Proprietary and Confidential

Page 19: Practical Uses for Web Services in Application Express

19© 2012 Oracle Corporation – Proprietary and Confidential