Presentation is loading. Please wait.

Presentation is loading. Please wait.

| 7. März 2007 | PHP & SAP | Martin Probst PHP talking to SAP Martin Probst.

Similar presentations


Presentation on theme: "| 7. März 2007 | PHP & SAP | Martin Probst PHP talking to SAP Martin Probst."— Presentation transcript:

1 | 7. März 2007 | PHP & SAP | Martin Probst PHP talking to SAP Martin Probst

2 PHP & SAP | Martin Probst | 7. März 2007 PHP / Outline demo of leave request desktop integration via Atom & iCalendar consuming web services in PHP feedback (technical, documentation, missing functionality)

3 PHP & SAP | Martin Probst | 7. März demo

4 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / iCalendar & Atom Web interfaces are location independent, lightweight etc. But users prefer rich clients sometimes Better interface Integrate with other tools Aggregate data from many sources Support open iCalendar and Atom formats easy to produce and consume wide range of applications open standards (RFCs) Implementation read only, but not necessarily (WebCAL, APP)

5 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / the basic code No real type system Create SOAP client, dynamic methods on it added Everything done at run time, but cached $wsdl = 'http://www.sap.com/.../ECC_EMPLEAVEREQBYIDQR.wsdl';http://www.sap.com/.../ECC_EMPLEAVEREQBYIDQR.wsdl' $soapclient = new SoapClient($wsdl); $message = array ( 'EmployeeLeaveRequestSelectionByID' => array ( 'EmployeeLeaveRequestID' => $ID ) ); $response = $soapclient-> EmployeeLeaveRequestByIDQueryResponse_In($message);

6 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / dynamic types PHP has a dynamic (or no?) type system Classes are constructed from WSDL/Schema on the fly Can supply user implemented classes Use hash maps/arrays to construct messages Consume result types directly, no declaration This is all the code necessary to query services minimal LOC, but no static type check $leaverequest = $response->EmployeeLeaveRequest; echo $leaverequest->LifeCycleStatusCode, $leaverequest->StartDate;

7 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / problems Automatic type conversion error prone is it a number, a string, a bird? Unstable language : _toString semantics change, Datetime class added backwards incompatible changes, break code Object oriented system strange at best Field visibility not enforced Types sometimes case insensitive

8 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / soap issues SOAP API added in PHP5 Hash map syntax for messages no support for namespaces in messages Serialization into XML overly liberal fails to detect many bugs easy to send non-WSDL-conforming messages Fehler bei der Konvertierung XML => ABAP (; FehlerId: ; ( ) ) $message = array ( 'EmployeeLeaveRequestSelectionByID' => array ( 'EmployeeLeaveRequestID' => $ID ) );

9 PHP & SAP | Martin Probst | 7. März 2007 PHP / consuming web services / soap issues Arrays weird - if its only one element, its not an array need special case code everywhere Difficult to manage types in non typed system EmployeeLeaveRequest type different in services PHP has no way to handle this Create messages as hashmaps for each request $elr = $res->EmployeeLeaveRequest; if (is_array($elr)) { $elr = array ($elr); }

10 PHP & SAP | Martin Probst | 7. März conclusion PHP small server footprint low complexity (~2000 LOC, zipped ~60KB) quick development cycle bad programming language rather go for Ruby / Python Services see other feedback last modified for service would be nice


Download ppt "| 7. März 2007 | PHP & SAP | Martin Probst PHP talking to SAP Martin Probst."

Similar presentations


Ads by Google