Skip to Main Content
PHP 5 Kochbuch, Third Edition
book

PHP 5 Kochbuch, Third Edition

by David Sklar, Adam Trachtenberg, Carsten Lucke, Matthias Brusdeylins, Ulrich Speidel, Stephan Schmidt
September 2009
Intermediate to advanced content levelIntermediate to advanced
912 pages
48h 11m
German
O'Reilly Verlag
Content preview from PHP 5 Kochbuch, Third Edition

15.5 SOAP-Anfragen ohne ein WSDL-Dokument senden

Problem

Sie möchten eine SOAP-Anfrage senden. Allerdings steht Ihnen keine WSDL-Beschreibung des SOAP-Diensts zur Verfügung, und Sie müssen die Anfrage von Hand ausführen.

Lösung

Verwenden Sie die SOAP-Erweiterung von PHP 5, übergeben Sie anstelle einer WSDL-URL hier null sowie weitere Parameter und rufen Sie den Dienst über die __soapCall()-Methode des SoapClient-Objekts auf. Hier sehen Sie einen Ausschnitt aus einem Client-Programm, das den SOAP-Dienst von Google verwendet:

$client = new SoapClient(null, array( 'location' => 'http://api.google.com/search/beta2', 'uri' => 'urn:GoogleSearch', 'style' => SOAP_RPC, 'use' => SOAP_ENCODED ) ); $params = array( new SoapParam('XXXXXXXXXXX', 'key'), new SoapParam('php5', ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP programmieren unter Windows

PHP programmieren unter Windows

Arno Hollosi
CSS Kochbuch, 3rd Edition

CSS Kochbuch, 3rd Edition

Joergen Lang, Christopher Schmitt

Publisher Resources

ISBN: 9783868993271Purchase book