Bop Architecture Training: Web Services
Bop Architecture Training: Web Services
Architecture
Training
Part 11.5
Web Services
What are Web Services?
- Web Services — collection of standards for distributed,
multiplatform data exchange
- XML – data formatting
- SOAP – message exchange
- WSDL – service description
- Widely recognized standards, combined with HTTP as a
wire protocol, is a leap forward for system-to-system
communication
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
General Web Service flow (single point)
Enterprise
application
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Advantages of Web Service Technology
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
The New Model: Web Services
A Web Service is accessible regardless of
platform or device
Mobile
device
SOAP
server
End user app
Enterprise
application
Enterprise
application
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Using Web Services
- Web Services consumer needs support for the standards
- XML, SOAP, WSDL, HTTP
- Many commercial and open source toolkits available for
many environments, from numerous vendors
- C#, C++, VB, Java, Perl, Python, JavaScript, etc.
- Apache, BEA, IBM, Microsoft, Sun, etc.
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Web Services in Service Desk
- 6.0
- First version, implemented in .NET
- Post GA patch, J2EE version
- R11
- Two web service interfaces, both implemented with
Java
- Post 6.0 GA interface – exact same WSDL for backwards
compatibility
- New R11 interface
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
New Stuff in the R11 Web Service
- Java only – no more .NET support
- Methods to add and update “old-style” workflow tasks
- File attachments (uses DIME protocol)
- More logon validation options
- SD and KT in same WSDL
- Enhanced return data
- can return lists along with object details
- Attribute details more refined – include both data value
and common name (for SRELs)
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
What can we do with this Stuff?
- Service Desk
- Create/Update most any object (Requests, Assets, Contacts, etc.)
- Transfer, Escalate
- Activity Logs
- Workflow Task updates
- Queries
- File Attachments
- Knowledge Tools
- Search
- Create/update/rate documents
- View categories and decision trees
- Add bookmarks
- And more!
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
What do Clients do with this stuff?
(Anything!)
- Utilities
- “service aware”
- Embedding support capabilities inside an application
- “ServicePlus Research service” in MS Office from Software
Delivery
- Open ticket within Broken Link page
- Enable app to open and update tickets automatically,
search knowledge for self-help, etc.
- Integrations
- Indus, Harvest, etc.
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Service Aware Policies
- Facilitate creation and operation of service aware
applications
- Controls
- When an app opens a ticket
- Detects duplicates
- Ticket type/template depending on situation
- Limits number of operations from client
- Easy to change behavior – update data on the UI
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Service Aware Policy
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Policy Problem Types
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
SA Policies – how it works
- Before an application is made service aware, designers
decide what types of problems it will potentially report
- Create a Service Aware Policy in web client
- Set unique code
- Optionally generate PKI encryption key
- Define problem types
- Determine action, ticket type/template to use, return data
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
SA Policies – how it works
- Service aware app specifies policy to use with
loginService() or loginServiceManaged()
- Managed logon uses PKI key
- Use “High level” web methods: createTicket, closeTicket,
logComment, getPolicyInfo
- CreateTicket() much simpler than createRequest
- Supply optional end user, description and problem type
- What happens is controlled by policy
- Create ticket, do nothing, return data…
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
SA Policies - PKI
- PKI key optionally associated with Policy
- Client app may logon using policy code encrypted with
private key
- No need to update username/password on client side,
reduces maintenance
- Normal login() method applies Default Policy
- “High level” web service methods
- createTicket()
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Service Aware Policies
- Clients may, if needed, extract Policy data to use on
different SD installations
- R11 – CA mainframe products are service aware - use
policies and ticket templates
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Web Service Architecture
- Uses Apache Axis 1.1 implementation of SOAP standard
for Web Service technologies (SOAP, WSDL, etc.)
- May upgrade to Axis 1.4 or 2.0 for R12
- Axis servlet runs under Tomcat
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Tomcat
Axis Servlet
JNI
Sda60.dll Sda65.dll
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Important Modules
- Usdjws.jar – 6.0 version (Java)
- Usdjws65.jar – r11 version (Java)
- Sda65.dll, sda60.dll – SDA library (C++)
- api.maj, api.spl – implements much of the web service
method logic
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Java Modules
- Method interface written by development
- Support code generated by Axis tools
- Jar file must be included in Axis WEB-INF/lib directory
- Implements handlers for each web service method
- Most passed off to SDA module via JNI
- Class loading problems
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
SDA Module
- Intent: provide C++ API to service desk
- Push as much business logic/implementation to majic
layer
- Manages web service sessions, application of Service
Aware policies, PKI stuff
- Code shared with bopsid.dll and upload.dll
- 6.0 and r11 version essentially the same
- Must be in Tomcat classpath
- Passes web service method requests to domsrvr, boplgin
and other modules
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Fun with WS
- View WSDL from Axis main page
- http://localhost:8080/axis
- WSDL is generated dynamically from the Java code
- Sample code in /samples/sdk/websvc
- QA test driver
- Example using PKI stuff
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Debugging – Important Log Files
- NX_ROOT/log/*
- SD-specific errors in stdlog.x
- pdm_tomcat.log (Web service is hosted in Tomcat)
- NX_ROOT/log/j*.log
- NX_ROOT/bopcfg/www/CATALINA_BASE/logs – more
Tomcat logs, something may show up here
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Debugging - Tracing
- TCPMON – Apache Axis tool to monitor SOAP messages
between Tomcat and client
- Java portion of code
- System.out.println
- Debug in Eclipse with Tomcat plugin
- SDA Module (C++)
- Simply attach debugger to java (Tomcat) process
- boplog sda process
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Patching
- Do not change the WSDL interface (public methods in
USDImpl.java)!
- Sda60 == sda65 == upload (we make a copy of sda65.dll
in the uds65 build directory and rename to sda60.dll;
therefore the sda.dll built/baked within the uds directory
for R6 is not a delivered product)
- Fix one, you’ve fixed the other
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Resources
- Web Service User Guide – essential reading
- Sample code in NX_ROOT/samples/sdk/websvc/java
- QA Test Driver
- In file pack
- Axis - http://ws.apache.org/axis/
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Questions
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Web Services Lab
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.
Lab: Web Services Java Example
1. Compile the web services sample file JWS.java in
$NX_ROOT\samples\sdk\websvc\java
For background:
- Read the comments in the source file
- Examine the supplied batch file compile_lab11.5.bat
2. What does JWS.java do? Try changing the description of
the request it creates.
© 2005 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.