using the cascade server web service api, by artur tomusiak

40
Artur Tomusiak Senior Software Developer Cascade Server Web Services

Upload: hannonhill

Post on 25-Jun-2015

709 views

Category:

Technology


5 download

DESCRIPTION

In this session, we will show you how to execute web services operations. Although our language of choice will be PHP, most of the material can be applied to other languages as well. You will also learn how to understand Cascade's wsdl file without looking up any additional documentation. We will go through example code for the most commonly used operations. This session is for users who have basic programming knowledge and would like learn how to write automated scripts for Cascade Server.

TRANSCRIPT

Page 1: Using the Cascade Server Web Service API, by Artur Tomusiak

Artur TomusiakSenior Software Developer

Cascade Server Web Services

Page 2: Using the Cascade Server Web Service API, by Artur Tomusiak

Introduction

What's Ahead:• What is a web service?• Real life applications• Cascade Server Web Services Operations• Understanding the WSDL file• Code examples for most commonly used

operations• What is coming in Cascade Server 7.2?

Page 3: Using the Cascade Server Web Service API, by Artur Tomusiak

What is a web service?

Web Service is a way to communicate between your own application and Cascade Server.

Cascade Server uses SOAP for web services which uses XML format to send and receive information

Page 4: Using the Cascade Server Web Service API, by Artur Tomusiak

Real life applications

• Importing/exporting content• Handling form submissions• Updating access rights on multiple assets for a

single user or group• Advanced bulk change• Bulk update content• Selective publishing of specific assets only• Data Definition Page to Data Definition Block

conversion

Page 5: Using the Cascade Server Web Service API, by Artur Tomusiak

Authentication

Each operation needs to be authenticated using a username and password

The operation is then executed as if that User performed the operation in the web UI:• Given User is the author of the operation • Permissions and abilities are verified• Audits are created for that User

Page 6: Using the Cascade Server Web Service API, by Artur Tomusiak

Available operations

http://yourcascadeinstance.com/ws/services

Most frequently used operations:• Create• Read• Edit • Delete• Copy• Read/Edit Access Rights• Publish

Page 7: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL File

http://.../ws/services/AssetOperationService?wsdl

Page 8: Using the Cascade Server Web Service API, by Artur Tomusiak

Important keywords in WSDL

"complexType" and "simpleType"

Page 9: Using the Cascade Server Web Service API, by Artur Tomusiak

Important keywords in WSDL

"element"Attributes: "minOccurs", "maxOccurs" and "type"

Comments

Page 10: Using the Cascade Server Web Service API, by Artur Tomusiak

Important keywords in WSDL

"extension"

Page 11: Using the Cascade Server Web Service API, by Artur Tomusiak

Important keywords in WSDL

"choice"

Page 12: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Find necessary elements to create an XML Block

Page 13: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 14: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 15: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 16: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 17: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 18: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 19: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Page 20: Using the Cascade Server Web Service API, by Artur Tomusiak

WSDL reading example

Required:• xml• parentFolderId or parentFolderPath• name

Optional:• expirationFolderId or expirationFolderPath• metadataSetId or metadataSetPath• Metadata fields (title, displayName, etc.)• siteId or siteName

Page 21: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesClient and authentication

Page 22: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesCreate

Page 23: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesCreate

Page 24: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesRead

Page 25: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesRead

Page 26: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesRead

Page 27: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesEdit

Page 28: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesEdit

Page 29: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesDelete

Page 30: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesCopy

Page 31: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesCopy

Page 32: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesCopy

Page 33: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesReadAccessRights

Page 34: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesEditAccessRights

Page 35: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examplesEditAccessRights

Page 36: Using the Cascade Server Web Service API, by Artur Tomusiak

PHP code examples

https://github.com/hannonhill/Webservices-PHP-Sample-Project

Use correct branch

Not always backwards compatible

Follow "Web Services Changelog" for each version

http://www.hannonhill.com/kb/Web-Services/Web%20Services%20Changelog/index.html

Page 37: Using the Cascade Server Web Service API, by Artur Tomusiak

Limitations

• Can’t access past versions of assets and drafts• Can’t render assets• Can’t use tools• Can’t change preferences• Can’t change configuration files• Can’t view or interact with publish queue• Certain operations can be limited

Page 38: Using the Cascade Server Web Service API, by Artur Tomusiak

What is coming in Cascade 7.2

• ListAllSites• ReadWorkflowSettings• EditWorkflowSettings• ListSubscribers• Providing Destinations when publishing• “Maintain absolute links” for Pages

Page 39: Using the Cascade Server Web Service API, by Artur Tomusiak

Questions

Page 40: Using the Cascade Server Web Service API, by Artur Tomusiak

Thank you

Artur [email protected]