Evaluating Php As A Technology Platform For Soa Implementations
1. Evaluating PHP as a
Technology Platform
for SOA Implementations
Vedanta Barooah
Hewlett-Packard Company
2. Introduction
• Myself:
Hewlett-Packard (Consulting & Integration)
Consultant for Open Source Services
• Linux
• Middleware
• PHP, Scripting
• Java/ J2EE (Learning… ☺)
• Enterprise Directories
• Databases
• Open Source Governance
Systems and Network Infrastructure
Past: Web Developer, System Admin
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 2
for SOA Implementations
3. Evaluating PHP as a Technology Platform
for SOA Implementations
• SOA and SOA @ HP
• The SOA Sandbox
• Component Evaluations
• Conclusions
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 3
for SOA Implementations
4. Why SOA? - The Business Benefits
Reduce
Increase costs
agility
• Reduce time-to-market for new • Reduce IT resource costs for
products and services maintenance
• More revenue from better • Reduce costs related to
operational capability providing new functionality
• More revenue from newly • Eliminate redundant systems and
enabled capabilities architectures
• Increase IT innovation spend
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 4
for SOA Implementations
5. SOA – Technical Characteristics
• Abstraction of functionality into services
• Loose coupling
• Composition of new services
• Portable business logic
• Interfaces are robust to change
Evaluating PHP as a Technology Platform PAGE 5
for SOA Implementations
6. Example : Transaction Taxes in the Enterprise
Before
ERP 1 ERP 2 Finance E Comm
Tax Calculation
Tax Reporting
USA Korea Brazil Germany
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 6
for SOA Implementations
7. Example : Transaction Taxes in the Enterprise
After ERP 1 ERP 2 Finance E Comm
Tax Calculation
Tax Calculation Service
Data
Warehouse
Tax Reporting
USA Korea Brazil Germany
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 7
for SOA Implementations
8. Implementation
Business Application 1 Business Application N
BA Adapter BA Adapter
XML Router
Data Buffer
Adapter Adapter
Data Warehouse
Tax Engine 1 Tax Engine N
NAME OF THE SESSION COMES HERE
11-Oct-07 PAGE 8
9. SOA @ HP – Why are we doing this?
• HP’s Adaptive Infrastructure Strategy
• Significant investments in SOA
• Technology agnostic – supports both Open
Source and commercial platforms
• Need for characterization of SOA Infrastructure
Components
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 9
for SOA Implementations
10. Evaluation Criteria
•Feature set
Functionality
•Relevance to test app
•Programmatic APIs
Adaptability
•XML APIs
•GUIs
•Reliability/Stability
RAS
•(High) Availability
•Scalability / Performance
•Built-in management and
Manageability
monitoring functions
•Relevance to test app
•IDE support
Developments Tools
•Other tools support
•License costs
Cost
•Support/training costs
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 10
for SOA Implementations
12. What is it?
• A test and validation sandbox for SOA
infrastructure components
• A development environment and runtime
environment for web services and clients
• A demonstration environment
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 12
for SOA Implementations
13. The SOA Eco System
Client 2
Client 1 Client N Client Layer
Infrastructure Components: Service Bus, SOA
Registry, Workflow/BPM, Security, Infrastructure
Management, etc. Components
Web Services Layer
Service1 Service 2 Service 3 Service M
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 13
for SOA Implementations
14. Sample Application
“Quickloans” Banking Application
• Business Processes
• Server Components
• Client Components
• Web Services
• Commercial and Open Source Technologies
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 14
for SOA Implementations
15. Business Processes
Bank
Customer Bank VP
Manager
Start
Customer
Registration
Customer
Loan
Application
Manual
Low Credit Score
Credit Score
Loan
Check
Approval
High Credit Score
Loan Approved
Logout
Stop
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 15
for SOA Implementations
16. Technology View
MODEL
CONTROLLER
VIEW
Frontend (PHP)
MySQL
Hibernate
LDAP
Web Services
Reports (PHP) JNDI
J2EE
PHP5 / SOAP
MySQL
PHP
WAP (PHP)
C#
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 16
for SOA Implementations
17. Software Components
Frontend UI (Customer UI & VP Reports) Manager Approve/ Reject UI
Mobile Client
PHP5 Java
PHP5
XFire
SOAP
SOAP
Credit Score WS
ManualLoanApproval
ManualLoanApproval
AutoLoanApproval
AutoLoanApproval
PHP
LoanApplication
LoanApplication
LoanReporting
LoanReporting
Authorization
Registration
Registration
LoanQuery
LoanQuery
WS
WS
WS
WS
WS
WS
NuSOAP
WS
WS
Core Application
JNDI
JBoss Web Services
OpenLDAP Directory
Business Logic
Hibernate Credit Score WS
ASP .Net
MySQL Database
C#
SUN/BEA JVM
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 17
for SOA Implementations
18. SOA Evaluation Scenario
Service #1
PHP
Service #2
UDDI
PHP
Rule Engine
Clients
ESB
PHP (WAP)
Service n
Evaluating PHP as a Technology Platform
11-Oct-07
for SOA Implementations
20. PHP Components
• Most web clients, reporting and mobile client
• Simpler web services in PHP
• Services written using NuSOAP and PHP5 SOAP
Extn
• Clients written in PHP5 SOAP extensions
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 20
for SOA Implementations
21. Java Components
• JBossWS Web Services Library
• Web/EJB Container – JBoss AS
• Wrapper services
Authentication / Authorization using LDAP
Data access using Hibernate/MySQL
• Tomcat / XFire for building Java client
• Used JSR-181 annotations to simplify coding,
auto-generate WSDL and XML metadata
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 21
for SOA Implementations
22. Why PHP?
• Rapid development and debugging
(Compared to Java)
• Wide availability of libraries for integration and
extension (XML, String,… extensions)
• Many frameworks (Report Generation, Web
Services, Frontend, RAD, MVC)
• Lesser lines of code due to the dynamic nature
of the language
• Extensive API with custom extensions
• Popular language with a “not so steep” learning
curve
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 22
for SOA Implementations
23. Lesser LOC and Maintenance Effort
http://server/wsdl
PHP
User[ ] getUsers(role) # using PHP5 Soap
$wsdl = “http://server/wsdl”;
Java $input = array(role=>“admin”);
$cl = new SoapClient($wsdl);
$users = $cl->__soapCall(‘getUsers’, $input);
WSDL tool
var_dump($users);
•Proxy Class (stub)
•User class
Client.java
Import Proxy
Import User
Proxy p = new Proxy();
User [ ] p.getUsers(“admin”);
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 23
for SOA Implementations
24. PHP for Web Services
• Easier to create (compared to Java)
• Fewer lines of code
• WSDL generation on the fly
• Platform of choice when not integrating with
legacy systems.
Evaluating PHP as a Technology Platform
PAGE 24
for SOA Implementations
25. PHP SOAP Implementations
• PHP5 SOAP Extensions
• PEAR::SOAP
• NuSOAP
• Others
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 25
for SOA Implementations
26. PHP5 SOAP
• Native PHP Extension
• Faster than any other PHP implementation
• Support - SOAP 1.1 , SOAP 1.2, WSDL 1.1
• Uses Gnome’s libxml
• Provides both server and client function
• WSDL has to be hand crafted
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 26
for SOA Implementations
27. Example : PHP 5 SOAP
Server
Client
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 27
for SOA Implementations
28. PEAR::SOAP
• Part of the PEAR repository
• Written in PHP
• Provides both client and server functions
• Does not depend on any PHP extension
• Depends on Pear – Mail, Mail_Mime, Net_DIME,
Net_SMTP, Auth_SASL, Mail_mimeDecode
• Works with PHP 4
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 28
for SOA Implementations
29. NuSOAP
• Written in PHP
• Works with PHP4
• Creates WSDL on the fly
• Provides server and client functions
• A class name clash with PHP5 soap
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 29
for SOA Implementations
30. Sample Code: PHP WS (NuSOAP)
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 30
for SOA Implementations
31. J2EE for Web Services
• Industry wide acceptance
• Stable, mature and scalable platform
• Integration with legacy applications
• Enterprise Features
High Availability / Failover
Messaging
Robust web services platform
Business Process Management / Orchestration
NAME OF THE SESSION COMES HERE
11-Oct-07 PAGE 31
32. PHP : Experiences so far
• Compact code – fewer lines compared to Java
• Reduced maintenance effort
• Fast code, test and debug cycle
• nuSOAP did not work with complex services
• Easy WSDL generation with nuSOAP
• PHP5 SOAP extensions faster than nuSOAP
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 32
for SOA Implementations
33. Java, C# : Experiences so far
• JBossWS simplifies web services creation
compared to old J2EE 1.4 model
• Annotations are easy, compared to XML
hacking
• Lack of in-depth JBoss documentation
• Visual Studio .net tooling is very flexible for C#
Web Services creation
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 33
for SOA Implementations
34. PHP WS Clients : Best Practices
• Reuse – API, Extensions, Classes
• Wrap Consumer Classes – simplify objects
• Layer UI and Logic - use Template Systems and
MVC frameworks
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 34
for SOA Implementations
35. SOA Infrastructure Components
• jUDDI - Registry
• HP SOA Manager (HP SOAM)
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 35
for SOA Implementations
36. UDDI/Registry
• jUDDI used as a UDDI registry
• Eclipse WST to publish web services - Also works
for PHP web services
• jUDDI client API to query registry
• PEAR::UDDI client API to query registry
ws.apache.org/juddi/
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 36
for SOA Implementations
37. HP SOA Manager
• Management critical for all SOA infrastructure
components
• Ability to integrate into upstream enterprise level
management platform
• Monitors transaction counts and latency
• Broker-based integration
www.managementsoftware.hp.com/products/soa/
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 37
for SOA Implementations
38. HP SOAM : Use Case
Client 2
Client 1 Client Layer
Client N
Web Services Layer
Service M
Service 2 Service 3
Service1
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 38
for SOA Implementations
39. SOAM – Broker based integration
Client 4
Client 2 Client 3
Client 1 Client Layer
SOAM Broker
BrokerM
Broker2 Broker3
Broker1 Services Layer
Service M
Service 2 Service 3
Service1 Web Services Layer
11-Oct-07
Evaluating PHP as a Technology Platform
PAGE 39
for SOA Implementations
40. SOAM – Experiences so far
• Seamless operation with Sandbox WS platforms
• Non-intrusive (no changes to WS required)
• GUI for creating proxy (broker) services
• Latency impact for broker based integration
• Run SOAM broker on the same machine that
runs the web service to be monitored
Risk of significant networking overhead impacting end-
to-end processing times
• Use multiple broker instances for scalability and
high availability
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 40
for SOA Implementations
42. Conclusions
• Open Source technologies for web services and web
services clients are valid implementation platforms
• Open Source SOA infrastructure components are often
API-centric and require custom coding for integration and
user interfaces
• Commercial SOA infrastructure components provide for
business process changes out of the box
• Interoperability between web services written in different
languages is not always straightforward
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 42
for SOA Implementations
43. PHP SOA Components
• SOAP for PHP
PHP SOAP Extensions (php.net/soap)
PEAR::SOAP (pear.php.net/package/SOAP)
NuSOAP (dietrich.ganx4.com/nusoap/)
eZ SOAP (ez.no)
• Pear UDDI (pear.php.net/package/UDDI)
• XML-RPC Toolkit (phpxmlrpc.sourceforge.net)
• Zend Framework (framework.zend.com)
• Blackbird ESB (blackbirdesb.org)
• Eclipse PDT, WST (eclipse.org)
• SDO (php.net/sdo)
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 43
for SOA Implementations
44. Questions and Resources
• Questions?
• HP & Open Source (hp.com/go/opensource)
• HP & SOA (hp.com/go/soa)
Evaluating PHP as a Technology Platform
11-Oct-07 PAGE 44
for SOA Implementations