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.