Path

ez.no / exponential / documentation / development / libraries / ez soap / consuming web services with ez soap client


Consuming web services with eZ SOAP Client

These documentation pages are no longer maintained. Please visit the new documentation site.

The following is a simple example of fetching some data from the service using the eZ SOAP Client and the service described at http://www.capescience.com/webservices/globalweather/index.shtml

<?php

// Switch off notices

error_reporting(E_ALL ^ E_NOTICE);

 

// Set the include path for Exponential

ini_set('include_path','/home/username/exponential-3.0-2/');

 

// Require the necessary libraries

require_once('lib/ezsoap/classes/ezsoapclient.php');

require_once('lib/ezsoap/classes/ezsoaprequest.php');

 

// Airport code for "Rost Flyplass" in Norway

$icao='ENRS';

 

// Create the SOAP client

$client=new eZSOAPClient("live.capescience.com","/ccx/GlobalWeather");

 

// Create a SOAP request

$request=new eZSOAPRequest("getStation","capeconnect:GlobalWeather:StationInfo");

 

// Add the airpoint code to the request

$request->addParameter("station",$icao);

 

// Send the request to get back a response object

$response = $client->send($request);

 

if( $response->isFault() ) {

   trigger_error($response->faultString());

   return false;

} else {

   echo ( '<pre>' );

   print_r( $response->value() );

   echo ( '</pre>' );

}

?>

My experience of eZ SOAP so far is that it's not stable at this time (3.0.2) it particular seems to have problems with multidimensional arrays as responses so be warned. You may want to consider PEAR::SOAP as an alternative for the time being, until 7x have brought eZ SOAP to a more stable basis.

For an example of PEAR::SOAP using WSDL see http://www.phppatterns.com/index.php/article/articleview/39/1/2/.

Note also if you need interim WSDL support with eZ SOAP Client, this can also be achieved with help from PEAR::SOAP WSDL - see http://www.phppatterns.com/index.php/article/articleview/40/1/2/ for details.

eZSoap recommends or links to EasySoap++. This C++ libary is very buggy. You might consider using another one.

Comments

log in or create a user account to comment.

Contents

Development

Extensions
Exponential datamodel
Exponential tuning and stability
Importing attribute data
Kernel
Libraries
    eZ xml
    eZ db
    eZ i18n
    eZ soap
       Consuming web services with eZ SOAP C...
       Hello World example
       Hello World example ( Exponential 3.5 + )
    eZ template
    eZ webdav
Scripting
Standards
System overview
Test Suite
Using Doxygen to create API documenta...


Created

29/04/2003
2:14:32 am
by Harry Fuecks

Last updated

04/07/2003
3:24:37 pm
by Bård Farstad

Authors

Harry Fuecks
Björn Dieding@xrow.de
Bård Farstad



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.