ezSOAPClient request/response

Author Message

Jorge estévez

Wednesday 07 May 2008 5:36:44 am

Hello,

I am using a Javascript object that builds a treeview, this treeview loads its branches (child nodes) dynamically using an XML file at the server using XMLHTTPRequest, there are two ways of doing this operation:

1. Passing the URL of the XML file with the structure of the branch that should be loaded
2. Reading the contents of the file and passing as a parameter "the XML string"

The implementation at our site allows us to generate once the URL has been given (e.g. www.mysite.com/index.php/content/view/xml/172) all of the Childs that belong to that node.

The problem:

As ez knows how to read the URL's generated by the system, but JS does not, we think it's a better idea to take into consideration the second option, so we would like to obtain a response chain with the XML needed and pass the information to the JS function. So we need to make a request, save the response in a variable and give this variable to the JS code.

In ez docs a native code is mentioned ezSOAPClient that suggest that it can be used to make requests and get responses to the server but I cannot find any hints that could give me an example on how to use it, I am quite sure this could be a solution but with no help at all I am kind of grounded.

Can someone point out information about the ezSOAPClient

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Maxime Thomas

Friday 09 May 2008 2:00:13 am

Hi,

I already done this on a old version of ez 3.6.x.

You have to :
- declare the SOAP server in the soap.ini file :

[GeneralSettings]
EnableSOAP=true

[ExtensionSettings]
# Extensions for SOAP functions.
# SOAP functions must be registered under soap/initialize.php
SOAPExtensions[]=your extension

- then create a file extension/<your extension>/soap/initialize.php
- You have to declare all of your functions :

function myfunction( $param1, $param2) 
{
...
return $result;
}

- Just after each function, you must register it in eZ :

$server->registerFunction( "myfunction",
         array("param1" => "string",
               "param2" => "array") );

And that's all.
The URL of the SOAP service is www.yoursite.com/soap.php

It may change for version 4.0.

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 20 2025 17:28:28
Script start
Timing: Jan 20 2025 17:28:28
Module start 'layout'
Timing: Jan 20 2025 17:28:28
Module start 'content'
Timing: Jan 20 2025 17:28:29
Module end 'content'
Timing: Jan 20 2025 17:28:29
Script end

Main resources:

Total runtime1.0008 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.9141151.2109
Module start 'layout' 0.00470.0027 739.125036.6484
Module start 'content' 0.00740.9927 775.7734558.7969
Module end 'content' 1.00010.0007 1,334.570311.8516
Script end 1.0008  1,346.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3117160.0002
Check MTime0.00130.1266160.0001
Mysql Total
Database connection0.00060.063210.0006
Mysqli_queries0.958595.7732540.0178
Looping result0.00050.0505520.0000
Template Total0.972697.220.4863
Template load0.00180.180420.0009
Template processing0.970897.001820.4854
Template load and register function0.00020.017110.0002
states
state_id_array0.00180.178510.0018
state_identifier_array0.00220.222120.0011
Override
Cache load0.00160.1568280.0001
Sytem overhead
Fetch class attribute can translate value0.00050.054520.0003
Fetch class attribute name0.00090.090330.0003
XML
Image XML parsing0.00070.065220.0003
class_abstraction
Instantiating content class attribute0.00000.003830.0000
General
dbfile0.00080.0782160.0000
String conversion0.00000.000740.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs