Advanced Web Services: Soap Headers and more Ron West Director of Professional Services PaperThin, Inc. CFUNITED – The premier ColdFusion conference www.cfunited.com
Web Services What’s so great about WS? What’s _not_ so great about WS? Working with Endpoints Headers Adding Security Example June 28th – July 1st 2006
What’s so great about WS? Their FUN! No, seriously though their fun! Still don’t believe me? Wait…you’ll see. June 28th – July 1st 2006
What’s so great about WS? Standards based development Interoperability Reduce coding efforts Common access to data June 28th – July 1st 2006
What’s _not_ so great about WS? Security (well sort of) Examples are currently very basic 2 Camps: Document vs. RPC Causes divergence in standards June 28th – July 1st 2006
What can we do to improve our WS? Add security layers Work with headers Build some persistence Build sensibly June 28th – July 1st 2006
<cffunction access=“remote”> Essentially a wrapper on the class org.apache.axis.client.Stub Some interesting data getHeaders() setHeaders() getUsername() getPassword() setAttachments() _setProperty() What does this look like? June 28th – July 1st 2006
WSDL Editing WSDL? Why would I want to do that? Manage endpoints June 28th – July 1st 2006
What is the endpoint The location (URI) for accessing a Web Service Can change during the call Adds an additional layer of security June 28th – July 1st 2006
Modifying an Endpoint June 28th – July 1st 2006
Security Authentication has multiple levels of complexity Are you authenticated? Are you authorized? June 28th – July 1st 2006
SOAP Response <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> … </soap:Header> <soapenv:Body> </soapenv:Body> </soapenv:Envelope> June 28th – July 1st 2006
Working with Headers Add a header: addSOAPRequestHeader Namespace (unique on application side) Name Value MustUnderstand (true, false [default] Called from your client June 28th – July 1st 2006
Working with Headers Using a header: getSOAPRequestHeader() Namespace (unique on application side) Name asXML (true, false [default] Called within your Web Service June 28th – July 1st 2006
Persistence Are Web Services persisted? Yes! Client (using ColdFusion) Standard Scopes (Application, Session) Server (AXIS Web Service Engine) SESSION_MAINTAIN_PROPERTY Cookies??? June 28th – July 1st 2006
Putting it together Talked about Interoperability Connecting the disparate systems Coding once using multiple times Connecting ERP solutions June 28th – July 1st 2006
Example CRM and CMS Integration June 28th – July 1st 2006
Additional Notes isSOAPRequest() getSOAPRequest() June 28th – July 1st 2006
Questions & Answers June 28th – July 1st 2006
Special Thanks Tom Jordahl (a.k.a. Web Service KING) Sean Corfield http://tjordahl.blogspot.com/ Mapped the “SessionHeader” for Salesforce Sean Corfield http://corfield.org/blog/ Produced first proof of concept June 28th – July 1st 2006