The Accelrys Enterprise Platform provides a number of methods for calling remote HTTP-based services. This session will provided a brief overview of service integration components and guidance on what to do with advanced integration scenarios. This talk will present a number of live example protocols that access SOAP and RESTful services.
1. (ATS3-PLAT02) Advanced SOAP and
RESTful Services Integration
Jason Benedict
Sr. Architect, Platform R&D
jason.benedict@accelrys.com
2. The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.
3. Pipeline Pilot Integration Points
Client Integration
Build clients that connect to Pipeline
Pilot and run protocol services.
Web Browser
Run Protocol .NET Client Java Client SOAP Client
Professional Client Command Line Web Port JavaScript Client
Client
JavaScript Client .NET Client
REST API Java Client SDK Web Services API
SDK SDK
Pipeline Pilot Enterprise Server
Web Apps Web Services API Admin Portal Help Portal
Grid System Integration (optional)
Protocol Runtime Environment
VB Script VB Script
Run SOAP & Telnet / ODBC /
(On (On Java Perl Python .NET SSH / SCP
Program HTTP FTP JDBC
Client) Server)
Java Perl .NET
VB Script Cmd Line
Classes Scripts Classes
Server Integration REST SOAP
Cmd Line DBs
Extend pipelines with new components that Service Service
integrate your code, data and services.
4. Agenda
• Intended Audience: Pipeline Pilot Protocol Authors and Component Developers
• SOAP Services
– SOAP Method
– SOAP Method with WSDL Support (Queued)
– SOAP Connector
• Customization of parameters and template
– Demos
• RESTful services
– Reader Components
– HTTP Connector
– Demos
• Advanced Results handling
– Data from XML, Data from JSON
– Data Tree Manipulators
– Demos
5. Web Service Access
Ease of Use
“Wrapped” SOAP Connector HTTP Connector Perl/Java/.NET
Component Server Components
• Scientific • Expert Pipeline • Expert Pipeline • Software
Pipeline Pilot Pilot User Pilot User Developers
User • Handles • Generic HTTP • Complex but
• Abstracted Complex Web component flexible
Component Services based • Great for direct • Leverage
• Web Service on WSDL handling of Perl/Java/.NET
underneath HTTP actions libraries and
handles • Swiss Army tools
complexity Knife for HTTP
Complexity and Flexibility
6. SOAP-based Web Services
• SOAP Web Services
– Messages usually sent over HTTP
– Always a POST, body is XML SOAP Doc
– Always includes “SOAP Action” header
– Always set Content-Type to “text/xml”
• WSDL
– Binding defines how messages are sent
(SOAP 1.1, 1.2, style, transport)
– Port Type defines operations and
messagse
– XML schema defines the data types in
messages
• WS-Policy
– Defines the Quality of Service features * - http://www.w3.org/TR/soap12-part0/
required by the service
– Security , Addressing, etc.
7. Accessing SOAP Services
Components Use When Don’t Use When / Caveats
SOAP Method • RPC-Encoded SOAP • Probably never
SOAP Method with WSDL Support • RPC-Encoded SOAP • DOC-LIT w/ Complex Types
• DOC-Lit SOAP w/ Simple Type
SOAP Method with WSDL Support • Same as above, but when threading • Be careful with DOS attacks
(Queued) is needed for through-put
SOAP Connector • DOC-Lit SOAP w/ Complex Types • RPC-Encoded SOAP
• Template flexibility is required
HTTP Connector • Need to create and POST your own
SOAP messages
• Need custom handling of outputs
• Need to customize HTTP settings
Java (On Server) • WS-Policy Requirements • Simpler methods will work
.NET (On Server) • Attachments or MTOM • Generally requires package
• Client stubs already exist deployment
• All else fails • HTTP Proxy settings and
authentication will not get picked up
8. SOAP Service Demos
• SOAP Method with WSDL Support (Queued)
• SOAP Connector
– Advanced XML Constructs with Amazon S3 Simulation
9. Debugging SOAP Problems
• Useful tools:
– Capture SOAP Packets
– TCPTrace.exe (http://www.pocketsoap.com/tcpTrace/)
– SOAP UI (http://www.soapui.org/)
• Socket debugging is available on the server
– Contact support for details
– Use sparingly since it very quickly creates huge log files
– Turn it off as soon as you are finished
10. RESTful Web Services
• Resources identified by URL’s
– http://localhost:9004/zoo/animals
– http://localhost:9004/zoo/animals/13
– http://localhost:9004/chem/img/C1CCCCC1C(CCN)OH
• Operations on resourced identified by VERBS:
– GET = get a representation of the resource
– PUT = update the resource given this data
– POST = create a new resource of this type with this data
– DELETE = delete the resource
– HEAD = get some meta-data about the resource
• Representation Format
– Accept: application/xml
– Content-Type: application/xml
11. Accessing RESTful Web Services
Components Use When Don’t Use When / Caveats
XML Reader (Generic) • You want to GET a representation of • You want something other than GET
JSON Reader a HTTP-based resource • You want another format
Text Reader
Binary Reader
HTTP Connector • You need to perform any operation • You have HTTP requirements not
but GET met by this component
• You need to customize settings like
timeout, headers or authorization
Java (On Server) • You have special HTTP requirements • Simpler methods will work
.NET (On Server) • You have a pre-built client library
• All else fails
12. HTTP Connector
• Swiss army knife for all HTTP
• Sends one request per Data Record
• Can be used for any type of HTTP Verb
– GET, POST, PUT, DELETE, HEAD, TRACE, OPTIONS, etc.
– specialized verbs as well, such as PROPFIND and MKCOL
13. HTTP Connector – Internal Handling
• HTTP communications from all standard components uses
the same library
– HTTP 1.1
– Basic, NTLM, and Negotiate Security
• “Authentication Options” or username/password in URL
• “Use Accelrys Credentials” allows single sign on from Pipeline Pilot
Clients
– Redirects on 300 responses
– Works with Proxy servers (Administration Portal setup)
– Decompress and dechunk based on Transfer and Content
encodings
– 100 Continue responses for requests with a body
14. HTTP Connector - POST
• Set Parameter names and values
– Values are Pilotscript expressions
• use Data Record properties
– One HTTP request for each input data record
• If no input, works like a Reader
– Add additional parameters
• FormMultipart or FormURLEncoded via “HTTP Post
Method”
15. HTTP Connector – Custom Options
• Add or override most HTTP request headers
– Cookies, Content-Type, etc.
– Cannot override “Authorization” or “Allow”
• Can now over-ride these headers in AEP 9.0
• Custom request body
– Disables the ability to set “Post Parameters”
• Timeout
16. HTTP Connector – Custom Options
• Limit size of response via “Maximum Response Size”
– Can also stream the data via “Maximum Property Size”
– Think of this like a “buffer” in code
– Only Data from XML and Data from JSON components understand this
method
• Return response headers
– Parsing Cookies, Content-Type, etc.
• Read as binary
– Creates a ByteArrayValue property
• Connection Options
– Keep-Alive, Expect: 100, 403 servers as though they sent 401
– Allow error response codes to be treated as valid
18. HTTP Connector –Debugging Tips
• Useful browser plugins
– Firefox: Live HTTP Headers
– Firefox: RESTClient
– Chrome: Advanced REST Client
• Socket debugging is available on the server
– Contact support for details
– Use sparingly since it very quickly creates huge log files
– Turn it off as soon as you are finished
19. Summary
• What we learned
– Connecting to SOAP Services
• SOAP Method Components
• SOAP Connector
• Results Handling
• Debugging
– Connecting to RESTful Services
• Readers
• HTTP Connectors
• Results Handling
• Debugging
• Managing Links
• Recommended Sessions
– (ATS3-DEV05) Coding up Pipeline Pilot Components
– (ATS3-DEV07) Pipeline Pilot as a Web Service Deployment Platform
20. The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.
For more information on the Accelrys Tech Summits and other IT & Developer information,
please visit:
https://community.accelrys.com/groups/it-dev