SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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)
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Kürzlich hochgeladen (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

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