Top Banner
41

Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware)...

Mar 18, 2018

Download

Documents

vantruc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform
Page 2: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Developing Web ServicesLalith Subramanian and

Don Robertson

Page 3: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Agenda• What are Web Services?

• Definition• Supporting technologies• High-level architecture• Benefits

• Why should we be interested?• Industry-wide buzz• Opportunities

• Building Web Services on top of Documentum• Summary

Page 4: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Agenda• What are Web Services?

• Definition• Supporting technologies• High-level architecture• Benefits

• Why should we be interested?• Industry-wide buzz• Opportunities

• Building Web Services on top of Documentum• Summary

Page 5: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Definition

• A well-defined set of operations that are network accessible using standardized technologies

• Just as XML is the universal data representation, so Web Services will become the universal behavioral representation

Page 6: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Sample Services

• B2B Arena• Hardware manufacturer reseller chain• Web services to monitor sales at resellers• Web services to source manufacturing to multiple

providers

• Consumer Arena• Web Services automatically searched to find nearest

photo printing service

Page 7: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Enabling Technologies

• XML• Universal structured data representation

• HTML for humans (B2C), XML for automation (B2B)

• HTTP• Universal transport• Firewall friendly• Payload agnostic

• HTTP + XML = transport + payload

Page 8: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Web Service Technologies

• SOAP• HTTP POST with XML envelope as payload• Standardized payload envelope• Service addressability

• WSDL• Web Services Description Language

• UDDI• Universal Description, Discovery, and Integration

Page 9: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

High-LevelArchitecture

Find/L

ocate

Publish Listing

Registry ServiceDescription

ServiceDescription

Provider

ServiceDescription

ServiceImplementation

Requestor

ServiceDescription

Bind/Invoke

Page 10: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

The Participants

Internet

Requestor

HTTP Server

SOAP Router

Implementation

Browser

Java Program

.NET Program

Requestor Provider

Page 11: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Architectural Flexibility

• Interaction Styles• Request/response or One-way• RPC or Message-style

• Transports• HTTP• SMTP• MOM (Message Oriented Middleware)

Page 12: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Platform Independence

• Vendor / Application software-neutral• Language neutral• Transport neutral• Widely available infrastructure• Endpoints are free to differ

• Loosely coupled

Page 13: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Agenda• What are Web Services?

• Definition• Supporting technologies• High-level architecture• Benefits

• Why should we be interested?• Industry-wide buzz• Opportunities

• Building Web Services on top of Documentum• Summary

Page 14: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

The Industry Buzz

• IBM, Microsoft, and Sun all agree!• So do we• Great minds seldom differ ☺

• Significant vendor investment• Sun One, .NET, etc.

• Mindshare• Documentum eContent Services initiative

Page 15: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Why the Momentum?

• XML content enables automated consumption• Facilitated by schema standards

• Promotes efficiency by automation• easy to measure in B2B scenarios

• Content is more dynamic• Provision of services via the Web• J2EE & .NET coexistence (inevitable)

Page 16: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

What’s in It for Me?• High leverage due to ease of reuse• If you’re in an IT department

• Offer Web Services to your business units• Based on re-purposable services provided by your

organization

• e.g., PDF rendering and archival service

• If you’re a Documentum partner• componentize your value-added offerings• offer as web services yourself or license

Page 17: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Agenda• What are Web Services?

• Definition• Supporting technologies• High-level architecture• Benefits

• Why should we be interested?• Industry-wide buzz• Opportunities

• Building Web Services on top of Documentum• Summary

Page 18: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

WS on Documentum ECM Platform

• Great Web Service characteristics• Fast connections in eContent Server 4.2• XML capabilities• Scalability!

• Write a service in Java using DFC• Consider message-oriented services with content• Let wizards help you with RPC-like services

• Remember: You can implement on one platform, consume on another

Page 19: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Starting to Build Web Services

• Well-encapsulated business logic• You may already have this

• Depending on available skills• Tools from IDE or application server vendor

• Service generation from EJBs, .NET components• BEA WebLogic, IBM WebSphere, Visual Studio .NET

• Simple-to-use, but not completely flexible

• Raw SOAP, WSDL, UDDI toolkits• Most flexible, but requires more code development• Most macho way to do things ☺

Page 20: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

HTTP vs. JMS(or Even SMTP)

• HTTP• assumes service availability• no guaranteed delivery

• JMS• quality of service choices• allows asynchronous service availability• can implement as message-driven bean

• SMTP possible too

Page 21: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

RPC vs. Message-Oriented

• RPC• less code• IDE wizard support

• Message-oriented• NOT talking about MOM transports!• coding is more manual (but simple)• easier to handle attachments• appropriate for one-way services

Page 22: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Stateless vs. Session Preserving

• Stateless• the default model

• Session preserving • available in some app servers• allows some state • HTTP only

Page 23: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Dynamic Discovery vs. Early Binding

• Dynamic Binding• Publish services to the world• Exploit external implementations

• Early Binding• UDDI? Don’t worry about it initially.• Easier to code• .NET and app server default

Page 24: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Preparation

• Getting started• Download a toolkit (Apache is free)• Use your app server/toolkit wizards• Skip UDDI for now

• Install Tomcat (currently 3.2)• Install Apache SOAP (currently 2.2)

Page 25: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

SOAP envelope

Message-Style Services With Documentum

Document(s) as Attachment

Documentum specific service parameters

• Treat content as an attachment(s) • Use simple XML for service parameters• NOT talking about MOM (e.g., MQSeries)!

Page 26: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

HTTP Server

SOAP Router

Wrapper(unmarshall)

Web ServiceImplementation

WorkflowInitiationwith DFC

An Example(Workflow)

Internet

Client

Document as Attachment

SOAP Envelope

DocumentumWorkflowparameters

Page 27: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Web ServiceImplementation

Standard Prototype

public void startWorkflow(Envelope envelope, SOAPContext requestContext,SOAPContext responseContext)

throws IOException,MessagingException,SAXException,Exception;

HTTP Server

SOAP Router

Wrapper(unmarshall)

WorkflowInitiationwith DFC

• Provide SOAP interface to DFC-based business logic

Page 28: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Extract DCTM Request Details

Web ServiceImplementation

HTTP Server

SOAP Router

WorkflowInitiationwith DFC

Wrapper(unmarshall)

// Extract workflow details from XML documentMimeBodyPart rootPart =

requestContext.getRootPart();String xml = rootPart.getContent().toString();StringReader reader = new StringReader(xml);DocumentBuilder xmldb =

XMLParserUtils.getXMLDocBuilder();Document doc =

xmldb.parse(new InputSource(reader));

// … process DOM document

Page 29: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Extract Attachment

// Extract MIME messageMimeBodyPart bp = requestContext.getBodyPart(1);

// Unpack MIME package// Content type: bp.getContentType() // Content-ID: bp.getContentID() // Content-Location: bp.getHeader( // org.apache.soap.Constants.HEADER_CONTENT_LOCATION,// null) // Separate out file that we will route// Filename: bp.getFileName() // Content: bp.getContent().toString()

// Now standard DFC manipulation ...

// ... send responseresponseContext.setRootPart(response, "text/xml");

Service

HTTP Server

SOAP Router

WorkflowInitiationwith DFC

Wrapper(unmarshall)

Page 30: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Apache Deployment

HTTP Server

Wrapper(unmarshall)

Web ServiceImplementation

WorkflowInitiationwith DFC

<isd:service xmlns:isd="http://xml.apache.org/xml-

soap/deployment"id="urn:workflow" type="message">

<isd:provider type="java"scope="Application"methods="startWorkflow">

<isd:javaclass=”com.documentum.ws.Workflow”static="false"/>

</isd:provider></isd:service>

SOAP Router

• Describes service to request dispatcher

Page 31: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Java Client-Side Implementation

// Build the SOAP message.Message msg = new Message();

// Add the document as an attachment.ByteArrayDataSource ds =

new ByteArrayDataSource("MyAttachment.txt"), null);DataHandler dh = new DataHandler(ds);MimeBodyPart bp = new MimeBodyPart();bp.setDataHandler(dh);bp.setFileName("MyAttachment.txt");bp.setHeader(

org.apache.soap.Constants.HEADER_CONTENT_LOCATION,"MyAttachment");

msg.addBodyPart(bp);

• Gory details of client code to invoke service• Typically handled by IDE-based code generator

Page 32: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Marshal Documentum

Parameters// Build the workflow service parameters.String workflowParameters =

"<package size=\"" + ds.getSize() + "\""+ "location =\"MyAttachment\""+ "name =\"MyAttachment.txt\"/>”;

String processId = "4b3cca4c80061ac3";String workflow = "purchase_order";workflowParameters +=

"<workflow processId=\"" + processId + "\""+ "note =\"web service test\"”+ "name =\"" + workflow + "\"/>”;

• Packaging of service-specific parameters• In this example, router id, attachment, etc.

Page 33: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Embed Within SOAP Message

// Construct SOAP messageString xml ="<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">";xml += "<s:Body>";xml += "<startWorkflow xmlns=\"urn:startWorkflow\">";xml += workflowParameters;xml += "</startWorkflow>";xml += "</s:Body>";xml += "</s:Envelope>";

Page 34: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Issue Web Service Request

// Issue Web Service request.StringReader reader = new StringReader(soapXML);DocumentBuilder xmldb = XMLParserUtils.getXMLDocBuilder();Document doc = xmldb.parse(new InputSource(reader));Envelope envelope =

Envelope.unmarshall(doc.getDocumentElement());

msg.send(messageRouterUrl, "", envelope);

Page 35: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Agenda• What are Web Services?

• Definition• Supporting technologies• High-level architecture• Benefits

• Why should we be interested?• Industry-wide buzz• Opportunities

• Building Web Services on top of Documentum• Summary

Page 36: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

The Future• Web Services Workflows

• WSFL• essential for service orchestration

• Schemas have to evolve• for true interoperability

• Widespread UDDI registration• Private / Public registries

• Standard service descriptions• ebXML?

Page 37: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Will Web Services be the new EDI?

• Platform neutrality• Convergence with ebXML• Low cost of entry

• Microsoft is ready• So tools will be excellent

• IDEs will dramatically simplify development• Automated deployment of EJBs as services

Page 38: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

So...

• Don’t get left behind!• Free tools• Easy to implement• Documentum ECM platform offers many

WS opportunities!

Page 39: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

References

• www.documentum.com/products/webservices.html• www.webservices.org• ibm.com/developerworks/webservices• dcb.sun.com/practices/webservices• msdn.microsoft.com/soap• msdn.microsoft.com/webservices• www.soapware.com• www.bea.com/products/weblogic/server/J2EE_Web_Ser

vices_WP.pdf

Page 40: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Other Presentations

• Documentum connector to EJBs• Excellent overview on using JDBC to build

transactional EJBs to deploy as services• Vaughn Vernon, CCC

• Web Development Environment• Kevin O’Connor, Documentum

Page 41: Developing Web Services - Dell EMC · PDF file• SOAP • HTTP POST with ... • RPC or Message-style • Transports • HTTP • SMTP • MOM (Message Oriented Middleware) Platform

Presentations on the Momentum Live

Web Site

To access this presentation (beginning later today):

Web site: www.momentumlive.comPassword: orlando2002