Double Newbie Struggles with Soap ... Seeks Clarity.

Author Message

Tom Walker

Saturday 08 January 2005 4:20:28 pm

I am working on a application that will require extensive external access to data collected in an eZ publish site. Soap appears to be the most logical long term solution. Since I am new to both soap and eZ Publish I'm experiencing some confusion. I have successfully completed the tutorial "Building an eZ publish site." In the process I became thoroughly impressed with eZ publish and proved that I'm not a complete idiot. When it came time to "prove in" the viability of soap, however, I failed to create a successful connection with the server.

I was successful at working through the tutorial "Consuming web services with eZ SOAP Client." I was able to get the little php file I wrote to spit back some interesting weather information about airports. So I think I have a tentative grasp on the client side of the equation. However when I point the client toward my own server, or rather try to point the client toward what I think is my server I'm getting the error "Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 157 bytes) in /srv/www/htdocs/ezpublish3/lib/ezxml/classes/ezxml.php on line 433". I believe that is where my problem lies, I don't really know how to tell the client to find the server.

Here is some more information about my situation that I hope will help in helping me. I have noticed the difference in the soap server for version 3.5. I have been careful to work through the tutorial entitled "Hello World example ( eZ publish 3.5 + )" because I have installed eZ Publish 3.5. Everything seems to have gone right except that I'm confused by the instructions:

<b>All we need to do is to give the request name, helloWorld, and the target namespace, http://ez.no/sdk/soap/examples. This object is then sent to the server via the client.</b>

I guess I don't know what "target namespace" means in this instance and I can't figure it out from the examples. I'll list below the files that I've created in hopes that someone will see what I've done wrong. I've changed my server's name in the exhibits to my.server.com, but just to be clear I'm using a real server name that works. Also I am not using a virtual server. Thanks in advance for any help I can get.

Tom Walker

Here is my Override file from settings/override/soap.ini.append.php
------------
#?ini charset="iso-8859-1"?
# eZ publish configuration file.
#
# NOTE: It is not recommended to edit this files directly, instead
# a file in override should be created for setting the
# values that is required for your site. Either create
# a file called settings/override/soap.ini.append or
# settings/override/soap.ini.append.php for more security
# in non-virtualhost modes (the .php file may already be present
# and can be used for this purpose).

[GeneralSettings]
EnableSOAP=true
Logging=disabled # not supported yet.

[ExtensionSettings]
# Extensions for SOAP functions.
# SOAP functions must be registered under soap/initialize.php
SOAPExtentensions[]=dataBridge
-----------------

Here is the extension/dataBridge/soap/initialize.php file:
--------------------
<?php
/*
Soap Functions File
This file is used to register functions for this eZpublish server.
*/

/*
Function Registration
*/

$server->registerFunction("helloWorld");

/*
Function Call Code
*/

function helloWorld()
{
return "Hello World!";
}

?>
---------------------------

Here is the listing for the client setup file which resides in the root folder for eZ Publish. I am accessing it with the browser location http://my.server.com/soaptest2.php.
---------------------------
<?php
// Switch off notices
error_reporting(E_ALL ^ E_NOTICE);

// Set the include path for eZ publish
ini_set('include_path','/srv/www/htdocs/ezpublish3/');

// Require the necessary libraries
require_once('lib/ezsoap/classes/ezsoapclient.php');
require_once('lib/ezsoap/classes/ezsoaprequest.php');

// Create the SOAP client
$client=new eZSOAPClient("my.server.com","/dataBridge");

// Create a SOAP request
$request=new eZSOAPRequest("helloWorld","dataBridge");

// 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>' );
}
?>
-------------------------

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 18 2025 22:11:13
Script start
Timing: Jan 18 2025 22:11:13
Module start 'layout'
Timing: Jan 18 2025 22:11:13
Module start 'content'
Timing: Jan 18 2025 22:11:14
Module end 'content'
Timing: Jan 18 2025 22:11:14
Script end

Main resources:

Total runtime1.1751 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.0469152.6406
Module start 'layout' 0.00600.0027 740.687539.4922
Module start 'content' 0.00881.1648 780.1797438.3750
Module end 'content' 1.17360.0015 1,218.554712.1250
Script end 1.1751  1,230.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2683160.0002
Check MTime0.00130.1148160.0001
Mysql Total
Database connection0.00150.126310.0015
Mysqli_queries1.121695.4411460.0244
Looping result0.00040.0304440.0000
Template Total1.144097.320.5720
Template load0.00220.186820.0011
Template processing1.141897.160720.5709
Template load and register function0.00020.017210.0002
states
state_id_array0.00080.066910.0008
state_identifier_array0.00170.148520.0009
Override
Cache load0.00190.1634750.0000
Sytem overhead
Fetch class attribute can translate value0.00040.037510.0004
Fetch class attribute name0.00070.059810.0007
XML
Image XML parsing0.00010.008710.0001
class_abstraction
Instantiating content class attribute0.00000.000310.0000
General
dbfile0.00170.1427100.0002
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
15content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 34
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs