Problem with soap in eZ publish

Author Message

Fabien Garnier

Wednesday 16 April 2008 8:57:21 am

Hello,
i installed eZ publish 4.0.0 and i try to use a soap client with.

So i created an extension/module inspired by "Building an eZ publish module" (eurofxref example) and here is the content of my my_extension\modules\my_extension\classes\test.php file :

<?php

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

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

class TestSoap
{
   function fetchSOAP()
   {
       $result = '';

       $icao='ENRS';

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

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

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

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

       if( $response->isFault() )
       {
         $result = 'ERREUR' ;

       } else {

         $result = $response->value() ;

         }

       return $result ;

   }
}

?>

I call the function in my my_extension\design\standard\templates\overview.tpl file with something like :

<h1>**************** TEST SOAP *****************</h1>
{let rates=fetch( 'testsoap', 'soap' )}

Value : {$rates}<br />

and i've got only :

**************** TEST SOAP *****************
Value :

on the display and no error.

I'm a beginner with both eZ publish and soap and i don't know what i'm doing wrong.
Someone can help me ?

Thank you.

Maxime Thomas

Wednesday 16 April 2008 11:27:51 pm

Try to put this in your code, just befor $result :

eZDebug::writeDebug($result);

Then, enable the debug via admin interface. The line of debug will appear in purple color.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:35:55
Script start
Timing: Jan 31 2025 04:35:55
Module start 'layout'
Timing: Jan 31 2025 04:35:55
Module start 'content'
Timing: Jan 31 2025 04:35:55
Module end 'content'
Timing: Jan 31 2025 04:35:55
Script end

Main resources:

Total runtime0.0160 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.1328151.2109
Module start 'layout' 0.00600.0030 739.343836.6484
Module start 'content' 0.00900.0053 775.992290.2656
Module end 'content' 0.01430.0017 866.257833.9922
Script end 0.0160  900.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002717.1158140.0002
Check MTime0.00127.4168140.0001
Mysql Total
Database connection0.00085.250710.0008
Mysqli_queries0.003119.438230.0010
Looping result0.00000.093810.0000
Template Total0.00138.110.0013
Template load0.00105.957810.0010
Template processing0.00032.091610.0003
Override
Cache load0.00074.226510.0007
General
dbfile0.00031.890780.0000
String conversion0.00000.055140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs