SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Stateful SOAP Webservices with Java and PHP
International PHP Conference 2008 – Spring Edition
Thorsten Rinne
Introduction

❙ Thorsten Rinne
❙ 31 years old
❙ Graduated in computer science
❙ Project manager at Mayflower GmbH, Munich
   ❙ Reporting applications
   ❙ Critical bank applications
   ❙ PHP Consulting
❙ PHP software development since 1999
❙ Founder and main developer of Open Source FAQ-
  management software phpMyFAQ since 2001
❙ Zend Certified Engineer (PHP 5)

                                                   Stateful SOAP Webservices
                                                    © MAYFLOWER GmbH 2008 2
Summary

❙ Introduction
❙ SOAP and PHP
❙ Stateful SOAP Webservices
❙ Implemention
❙ Real world example
❙ Questions and answers




                              Stateful SOAP Webservices
                               © MAYFLOWER GmbH 2008 3
What is SOAP?

❙ SOAP is a protocol for exchanging XML-based messages
  over computer networks
❙ It uses HTTP, HTTPS or SMTP
❙ SOAP is the successor of XML-RPC
❙ Advantages
   ❙ using SOAP over HTTP allows for easier communication
     through proxies and firewalls
   ❙ platform independent
   ❙ language independent
❙ Disadvantages
   ❙ Slower than technologies like CORBA
   ❙ Bad performance with binary data
                                                            Stateful SOAP Webservices
                                                             © MAYFLOWER GmbH 2008 4
A simple SOAP message

❙ Simple structure of a SOAP message

 <?xml version=quot;1.0quot;?>
 <s:Envelope
  xmlns:s=quot;http://www.w3.org/2001/12/soap-envelopequot;>
     <s:Header>
     </s:Header>
     <s:Body>
     </s:Body>
 </s:Envelope>




                                           Stateful SOAP Webservices
                                            © MAYFLOWER GmbH 2008 5
Using SOAP with PHP

❙ ext/soap can be used to write SOAP servers and clients
❙ Support of subsets of SOAP 1.1, SOAP 1.2 and WSDL 1.1
  specifications
❙ No built-in support for WS-Addressing!
❙ SOAP server
  $server = new SoapServer('some.wsdl',
       array('soap_version' => SOAP_1_2));


❙ SOAP client
  $client = new SoapClient('some.wsdl',
       array('soap_version' => SOAP_1_2));


                                                           Stateful SOAP Webservices
                                                            © MAYFLOWER GmbH 2008 6
Stateful SOAP Webservices

❙ By default, SOAP webservices are stateless
❙ A stateful SOAP webservice is a webservice that maintains state
  information between message calls
❙ Session ID is stored in the SOAP header with WS-Addressing (WS-A)
❙ How do stateful SOAP webservices work?
   ❙ Request by SOAP client
     CS
   ❙ SOAP session will be created by SOAP server
   ❙ Response from SOAP server to SOAP client with Session ID
     CS
   ❙ More interaction between client and server
❙ Used in mulit-user environments with multiple requests/responses
                                                             Stateful SOAP Webservices
                                                              © MAYFLOWER GmbH 2008 7
Implementation

Apache Axis2 example:

<wsa:ReplyTo>
   <wsa:Address>
      http://www.w3.org/2005/08/addressing/anonymous
   </wsa:Address>
   <wsa:ReferenceParameters>
      <axis2:ServiceGroupId xmlns:axis2=
         quot;http://ws.apache.org/namespaces/axis2quot;>
            urn:uuid:65E9C56F702A398A8B11513011677354
      </axis2:ServiceGroupId>
   </wsa:ReferenceParameters>
</wsa:ReplyTo>

                                            Stateful SOAP Webservices
                                             © MAYFLOWER GmbH 2008 8
PHP implementation

❙ ext/soap doesn‘t support SOAP sessions
❙ Would be possible with WSO2 Web Services
  Framework/PHP (WSO2 WSF/PHP) extension
❙ We have to overwrite the
  SoapClient::__doRequest() method from PHP to
  implement WS-Addressing support
❙ First, we have to add a WS-A class written by Rob Richards
  (http://www.cdatazone.org/files/soap-wsa.phps)
    ❙ Parses to the SOAP XML header
    ❙ Sets the session ID
    ❙ Also support for WS-Security (WS-S) if needed




                                                               Stateful SOAP Webservices
                                                                © MAYFLOWER GmbH 2008 9
PHP implementation (I)

class MyProject_SOAPClient extends SoapClient
{
    public function __doRequest($request, $location, $saction, $version)
    {
        $dom = new DOMDocument();
        $dom->loadXML($request);
        $wsasoap = new WSASoap($dom);
        $wsasoap->addAction($saction);
        $wsasoap->addTo($location);
        $wsasoap->addMessageID(); // Sets the session ID
        $wsasoap->addReplyTo();
        $request = $wsasoap->saveXML();
        return parent::__doRequest($request, $location, $saction, $version);
    }
}


                                                               Stateful SOAP Webservices
                                                                © MAYFLOWER GmbH 2008 10
PHP implementation (II)

class OurService {
    /* … */
    $axis2session = $this->_getSoapSession($this->soapClient->__getLastResponse());
    $soapHeader    = new SoapHeader('http://ws.apache.org/namespaces/axis2',
                                    'ServiceGroupId',$axis2session);
    $this->soapClient->__soapCall('getData', array(), null, $soapHeader);
    /* … */
    private function _getSoapSession($response) {
        $soapsession = '';
        $xml = new XMLReader();
        $xml->XML($response);
        while ($xml->read()) {
            if (strpos($xml->name, 'axis2:ServiceGroupId') !== false) {
                $xml->read();
                $soapsession = $xml->value;
                $xml->read();
            }
        }
        return $soapsession;
    }
                                                                Stateful SOAP Webservices
}
                                                                    © MAYFLOWER GmbH 2008 11
Welcome to the real world

❙ Various applications based on
   ❙ Java (main application)
   ❙ Excel with a included DLL written in C++
   ❙ Access/Visual Basic
   ❙ Web application in PHP (our project)
❙ All applications were using the same calculation logic but
  implemented in different programming language
❙ Big problems when the logic changes
❙ Solution
   ❙ Migration of the Access tool into the PHP application
   ❙ Build a SOAP service on top of the Java classes
   ❙ Replace the C++ written library and our PHP based library
     with the SOAP webservice
                                                               Stateful SOAP Webservices
                                                                © MAYFLOWER GmbH 2008 12
Welcome to the real world!
      Old architecture

                                     Microsoft Office Client PC

                                                       Microsoft Access and Excel




                                      mod_php
                                                                  MySQL
                                    Apache 2.0
                                                   Linux
J2EE Cluster (Calculation engine)                                            Stateful SOAP Webservices
                                                                              © MAYFLOWER GmbH 2008 13
Welcome to the real world!
  Current architecture
             J2EE Cluster (Calculation engine)
                                                      Microsoft Office Client PC




    Transfer by SFTP



                                    SOAP over HTTPS



                                           SOAP
                 SOAP

                                         mod_php
                 Axis2
java.class
                                                                   MySQL
                                       Apache 2.0
             Tomcat 5.5
                                                      Linux
                                                                             Stateful SOAP Webservices
                                                                              © MAYFLOWER GmbH 2008 14
Questions and answers




                        Stateful SOAP Webservices
                         © MAYFLOWER GmbH 2008 15
Thank you very much!

Thorsten Rinne, Dipl.-Inf. (FH)
Mayflower GmbH
Mannhardtstraße 6
D-80538 München
Germany
+49 (89) 24 20 54 – 31
thorsten.rinne@mayflower.de

Mais conteúdo relacionado

Mais procurados

A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom Joshua Long
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An IntroductionThorsten Kamann
 
WebServices in ServiceMix with CXF
WebServices in ServiceMix with CXFWebServices in ServiceMix with CXF
WebServices in ServiceMix with CXFAdrian Trenaman
 
A linux mac os x command line interface
A linux mac os x command line interfaceA linux mac os x command line interface
A linux mac os x command line interfaceDavid Walker
 
Spring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingSpring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingThorsten Kamann
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking TourJoshua Long
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLUlf Wendel
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data WeaveMohammed246
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector IntegrationAnilKumar Etagowni
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Web development with ASP.NET Web API
Web development with ASP.NET Web APIWeb development with ASP.NET Web API
Web development with ASP.NET Web APIDamir Dobric
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Antonio Peric-Mazar
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...Maarten Balliauw
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsMarkus Eisele
 

Mais procurados (20)

A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Spring 3 - An Introduction
Spring 3 - An IntroductionSpring 3 - An Introduction
Spring 3 - An Introduction
 
WebServices in ServiceMix with CXF
WebServices in ServiceMix with CXFWebServices in ServiceMix with CXF
WebServices in ServiceMix with CXF
 
A linux mac os x command line interface
A linux mac os x command line interfaceA linux mac os x command line interface
A linux mac os x command line interface
 
Spring 3 - Der dritte Frühling
Spring 3 - Der dritte FrühlingSpring 3 - Der dritte Frühling
Spring 3 - Der dritte Frühling
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
 
What is play
What is playWhat is play
What is play
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Mule CXF component
Mule CXF componentMule CXF component
Mule CXF component
 
Web development with ASP.NET Web API
Web development with ASP.NET Web APIWeb development with ASP.NET Web API
Web development with ASP.NET Web API
 
Jsf 2.0 in depth
Jsf 2.0 in depthJsf 2.0 in depth
Jsf 2.0 in depth
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
 

Semelhante a Stateful SOAP Webservices with Java and PHP

WSF PHP 2 Webinar Sep 2008
WSF PHP 2 Webinar Sep 2008WSF PHP 2 Webinar Sep 2008
WSF PHP 2 Webinar Sep 2008WSO2
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jaojedt
 
SOA with C, C++, PHP and more
SOA with C, C++, PHP and moreSOA with C, C++, PHP and more
SOA with C, C++, PHP and moreWSO2
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmersjphl
 
Mazda siv - web services
Mazda   siv - web servicesMazda   siv - web services
Mazda siv - web servicesOlivier Lépine
 
Multi client Development with Spring
Multi client Development with SpringMulti client Development with Spring
Multi client Development with SpringJoshua Long
 
WSO2 SOA with C and C++
WSO2 SOA with C and C++WSO2 SOA with C and C++
WSO2 SOA with C and C++WSO2
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructuregeorge.james
 
Pentesting With Web Services in 2012
Pentesting With Web Services in 2012Pentesting With Web Services in 2012
Pentesting With Web Services in 2012Ishan Girdhar
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Ido Flatow
 
Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy WSO2
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 

Semelhante a Stateful SOAP Webservices with Java and PHP (20)

WSF PHP 2 Webinar Sep 2008
WSF PHP 2 Webinar Sep 2008WSF PHP 2 Webinar Sep 2008
WSF PHP 2 Webinar Sep 2008
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jao
 
SOA with C, C++, PHP and more
SOA with C, C++, PHP and moreSOA with C, C++, PHP and more
SOA with C, C++, PHP and more
 
Mashups
MashupsMashups
Mashups
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
Mazda siv - web services
Mazda   siv - web servicesMazda   siv - web services
Mazda siv - web services
 
Multi client Development with Spring
Multi client Development with SpringMulti client Development with Spring
Multi client Development with Spring
 
WSO2 SOA with C and C++
WSO2 SOA with C and C++WSO2 SOA with C and C++
WSO2 SOA with C and C++
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
CSG 2012
CSG 2012CSG 2012
CSG 2012
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Node.js Workshop
Node.js WorkshopNode.js Workshop
Node.js Workshop
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
 
Pentesting With Web Services in 2012
Pentesting With Web Services in 2012Pentesting With Web Services in 2012
Pentesting With Web Services in 2012
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy Kick Start your Application Development and Management Strategy
Kick Start your Application Development and Management Strategy
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 

Mais de Mayflower GmbH

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mayflower GmbH
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: SecurityMayflower GmbH
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftMayflower GmbH
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientMayflower GmbH
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingMayflower GmbH
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...Mayflower GmbH
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyMayflower GmbH
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming MythbustersMayflower GmbH
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im GlückMayflower GmbH
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefernMayflower GmbH
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsMayflower GmbH
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalierenMayflower GmbH
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastMayflower GmbH
 

Mais de Mayflower GmbH (20)

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
 
Usability im web
Usability im webUsability im web
Usability im web
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Stateful SOAP Webservices with Java and PHP

  • 1. Stateful SOAP Webservices with Java and PHP International PHP Conference 2008 – Spring Edition Thorsten Rinne
  • 2. Introduction ❙ Thorsten Rinne ❙ 31 years old ❙ Graduated in computer science ❙ Project manager at Mayflower GmbH, Munich ❙ Reporting applications ❙ Critical bank applications ❙ PHP Consulting ❙ PHP software development since 1999 ❙ Founder and main developer of Open Source FAQ- management software phpMyFAQ since 2001 ❙ Zend Certified Engineer (PHP 5) Stateful SOAP Webservices © MAYFLOWER GmbH 2008 2
  • 3. Summary ❙ Introduction ❙ SOAP and PHP ❙ Stateful SOAP Webservices ❙ Implemention ❙ Real world example ❙ Questions and answers Stateful SOAP Webservices © MAYFLOWER GmbH 2008 3
  • 4. What is SOAP? ❙ SOAP is a protocol for exchanging XML-based messages over computer networks ❙ It uses HTTP, HTTPS or SMTP ❙ SOAP is the successor of XML-RPC ❙ Advantages ❙ using SOAP over HTTP allows for easier communication through proxies and firewalls ❙ platform independent ❙ language independent ❙ Disadvantages ❙ Slower than technologies like CORBA ❙ Bad performance with binary data Stateful SOAP Webservices © MAYFLOWER GmbH 2008 4
  • 5. A simple SOAP message ❙ Simple structure of a SOAP message <?xml version=quot;1.0quot;?> <s:Envelope xmlns:s=quot;http://www.w3.org/2001/12/soap-envelopequot;> <s:Header> </s:Header> <s:Body> </s:Body> </s:Envelope> Stateful SOAP Webservices © MAYFLOWER GmbH 2008 5
  • 6. Using SOAP with PHP ❙ ext/soap can be used to write SOAP servers and clients ❙ Support of subsets of SOAP 1.1, SOAP 1.2 and WSDL 1.1 specifications ❙ No built-in support for WS-Addressing! ❙ SOAP server $server = new SoapServer('some.wsdl', array('soap_version' => SOAP_1_2)); ❙ SOAP client $client = new SoapClient('some.wsdl', array('soap_version' => SOAP_1_2)); Stateful SOAP Webservices © MAYFLOWER GmbH 2008 6
  • 7. Stateful SOAP Webservices ❙ By default, SOAP webservices are stateless ❙ A stateful SOAP webservice is a webservice that maintains state information between message calls ❙ Session ID is stored in the SOAP header with WS-Addressing (WS-A) ❙ How do stateful SOAP webservices work? ❙ Request by SOAP client CS ❙ SOAP session will be created by SOAP server ❙ Response from SOAP server to SOAP client with Session ID CS ❙ More interaction between client and server ❙ Used in mulit-user environments with multiple requests/responses Stateful SOAP Webservices © MAYFLOWER GmbH 2008 7
  • 8. Implementation Apache Axis2 example: <wsa:ReplyTo> <wsa:Address> http://www.w3.org/2005/08/addressing/anonymous </wsa:Address> <wsa:ReferenceParameters> <axis2:ServiceGroupId xmlns:axis2= quot;http://ws.apache.org/namespaces/axis2quot;> urn:uuid:65E9C56F702A398A8B11513011677354 </axis2:ServiceGroupId> </wsa:ReferenceParameters> </wsa:ReplyTo> Stateful SOAP Webservices © MAYFLOWER GmbH 2008 8
  • 9. PHP implementation ❙ ext/soap doesn‘t support SOAP sessions ❙ Would be possible with WSO2 Web Services Framework/PHP (WSO2 WSF/PHP) extension ❙ We have to overwrite the SoapClient::__doRequest() method from PHP to implement WS-Addressing support ❙ First, we have to add a WS-A class written by Rob Richards (http://www.cdatazone.org/files/soap-wsa.phps) ❙ Parses to the SOAP XML header ❙ Sets the session ID ❙ Also support for WS-Security (WS-S) if needed Stateful SOAP Webservices © MAYFLOWER GmbH 2008 9
  • 10. PHP implementation (I) class MyProject_SOAPClient extends SoapClient { public function __doRequest($request, $location, $saction, $version) { $dom = new DOMDocument(); $dom->loadXML($request); $wsasoap = new WSASoap($dom); $wsasoap->addAction($saction); $wsasoap->addTo($location); $wsasoap->addMessageID(); // Sets the session ID $wsasoap->addReplyTo(); $request = $wsasoap->saveXML(); return parent::__doRequest($request, $location, $saction, $version); } } Stateful SOAP Webservices © MAYFLOWER GmbH 2008 10
  • 11. PHP implementation (II) class OurService { /* … */ $axis2session = $this->_getSoapSession($this->soapClient->__getLastResponse()); $soapHeader = new SoapHeader('http://ws.apache.org/namespaces/axis2', 'ServiceGroupId',$axis2session); $this->soapClient->__soapCall('getData', array(), null, $soapHeader); /* … */ private function _getSoapSession($response) { $soapsession = ''; $xml = new XMLReader(); $xml->XML($response); while ($xml->read()) { if (strpos($xml->name, 'axis2:ServiceGroupId') !== false) { $xml->read(); $soapsession = $xml->value; $xml->read(); } } return $soapsession; } Stateful SOAP Webservices } © MAYFLOWER GmbH 2008 11
  • 12. Welcome to the real world ❙ Various applications based on ❙ Java (main application) ❙ Excel with a included DLL written in C++ ❙ Access/Visual Basic ❙ Web application in PHP (our project) ❙ All applications were using the same calculation logic but implemented in different programming language ❙ Big problems when the logic changes ❙ Solution ❙ Migration of the Access tool into the PHP application ❙ Build a SOAP service on top of the Java classes ❙ Replace the C++ written library and our PHP based library with the SOAP webservice Stateful SOAP Webservices © MAYFLOWER GmbH 2008 12
  • 13. Welcome to the real world! Old architecture Microsoft Office Client PC Microsoft Access and Excel mod_php MySQL Apache 2.0 Linux J2EE Cluster (Calculation engine) Stateful SOAP Webservices © MAYFLOWER GmbH 2008 13
  • 14. Welcome to the real world! Current architecture J2EE Cluster (Calculation engine) Microsoft Office Client PC Transfer by SFTP SOAP over HTTPS SOAP SOAP mod_php Axis2 java.class MySQL Apache 2.0 Tomcat 5.5 Linux Stateful SOAP Webservices © MAYFLOWER GmbH 2008 14
  • 15. Questions and answers Stateful SOAP Webservices © MAYFLOWER GmbH 2008 15
  • 16. Thank you very much! Thorsten Rinne, Dipl.-Inf. (FH) Mayflower GmbH Mannhardtstraße 6 D-80538 München Germany +49 (89) 24 20 54 – 31 thorsten.rinne@mayflower.de