Trouble with eZ Publish Soap Hello World example

Author Message

Tom Walker

Thursday 13 January 2005 11:02:12 am

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:

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.

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

Bruce Morrison

Thursday 13 January 2005 11:44:06 pm

Hi Tom

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".

This error indicates that php has run out of memory while servicing the request. You will need to increase the memory_limit value (in php.ini) to a larger value and restart the webserver.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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