Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
WSO2 SOA with C and C++
1. SOA WITH C, C++, PHP …
Supun Kamburugamuva
supun@wso2.com
2. SOA Workshop
Santa Clara
Language of your choice
You must have Freedom to choose
You must have Reasons to choose
3. SOA Workshop
Santa Clara
Why C?
Most portable
Less memory
Faster
Many interesting applications written in C
HTTPD
Ruby
MySQL
PHP
4. SOA Workshop
Santa Clara
Why C++?
Widely used (and some legacy)
Financial, Banking, Telco, DBMS, Embedded
Performance, Flexibility, Control
5. SOA Workshop
Santa Clara
Why PHP?
Installed on over 20 million websites
1 million web servers
Easiest way to write services and clients
6. SOA Workshop
Santa Clara
SOA in a Heterogeneous World
7. SOA Workshop
Santa Clara
Expectations
Tooling for WSDL
Security
Interoperability
Binary attachments
Reliability
Support
8. SOA Workshop
Santa Clara
PHP Web Services Frameworks
Package Written in WSDL Security Attachments Reliability
PHP5 SOAP Ext C Partial No No No
NuSOAP PHP Yes No No No
SCA with PHP(IBM) PHP Yes No No No
WSO2 WSF/PHP C Yes Yes Ye s Ye s
9. SOA Workshop
Santa Clara
Framework that improves PHP user’s ability to
provide and consume Web services
Capable of dealing with secure and reliable
messaging even with binary data, the only PHP
software package to offer those features
The framework is inter-operable with non-PHP
implementations, allowing it to be integrated with
enterprise applications seamlessly
14. SOA Workshop
Santa Clara
C/C++ Web Services Frameworks
Package WSDL Security Attachments Reliability
HydraExpress Partial No Partial No
gSOAP Yes Partial Yes No
WSO2 WSF/C Partial Ye s Yes Yes
WSO2 WSF/C++ Partial Ye s Yes Yes
15. SOA Workshop
Santa Clara
Designed for embedding within C or C++ software
stacks to enable Web services
All-in-one solution for the building and deploying of
Web services
Widest range of WS-* specifications
implementations
WS-Addressing, WS-Policy, WS-Security, WS-
SecurityPolicy, WS-Reliable Messaging, MTOM and
WS-eventing
16. SOA Workshop
Santa Clara
C++ Example - Service
1. #include <ServiceSkeleton.h>
1. using namespace wso2wsf;
1. class Echo: public ServiceSkeleton
2. {
3. public:
4. WSF_EXTERN WSF_CALL Echo(){};
1. OMElement* WSF_CALL invoke(OMElement *message, MessageContext *msgCtx);
1. OMElement* WSF_CALL onFault(OMElement *message);
1. void WSF_CALL init(){};
2. };
1. OMElement* Echo::invoke(OMElement *element, MessageContext *msgCtx)
2. {
3. OMElement *echoElement = new OMElement(element->getLocalname(),
4. new OMNamespace(element->getNamespace(false)->getURI(),
5. element->getNamespace(false)->getPrefix()));
6. OMElement *textElement = new OMElement("messsage");
7. echoElement->addChild(textElement);
8. textElement->setText("Hello World");
9. return echoElement;
10. }
19. SOA Workshop
Santa Clara
Web Services are Faster
20. SOA Workshop
Santa Clara
Web Services are Still Faster
For secure services
10K messages C implementation x10 – x15 times
faster than Java
100k messages C implementation x6 – x8 times faster
than Java
21. SOA Workshop
Santa Clara
WSF/C++ Features
SOAP 1.1 and SOAP 1.2
WS-Addressing
1.0
Submission
MTOM and SwA
Support for caching large attachments
WS-Security
Base security standards mean that messages can be protected using
Encryption, Authentication and Signature
Including WS-SecureConversation and WS-Trust
WSDL2CPP Code Generation tool
Supports generating client stubs, service skeletons, build scripts and
deployment scripts
22. SOA Workshop
Santa Clara
WSF/C++ Features
WS-Policy and WS-Security Policy
Enables using industry standard XML to confgure security
SSL Enabled Transport Layer
Reliable Messaging 1.0, 1.1 and WS-RMPolicy
Enables reliability between platforms including message resending, duplicate detection and
persistence
Full REST support (GET, PUT, DELETE, POST)
with custom URI Mapping
Enables mapping a REST API easily and naturally
Useful tools
Tcpmon
wsclient
23. SOA Workshop
Santa Clara
References
Various Web Services Frameworks
http://wso2.org/projects/wsf
Apache Axis2/C Web Services Performance
http://wso2.org/library/3532
Example applications for SOA
http://incubator.apache.org/stonehenge/
PHP Web Services Blog
http://phpwebservices.blogspot.com/