PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SoapServer->setPersistence> <SoapServer->handle
Last updated: Fri, 26 Dec 2008

view this page in

SoapServer->setClass

(No version information available, might be only in CVS)

SoapServer->setClass Sets class which will handle SOAP requests

Descripción

SoapServer
void setClass ( string $class_name [, mixed $args [, mixed $... ]] )

Exports all methods from specified class.

The object can be made persistent across request for a given PHP session with the SoapServer->setPersistence method.

Lista de parámetros

class_name

The name of the exported class.

args

These optional parameters will be passed to the default class constructor during object creation.

Valores retornados

No value is returned.

Ejemplos

Example #1 Some examples

<?php

class foo {
    function 
foo() 
    {
    }
}
$server->setClass("foo");

class 
bar {
    function 
bar($x$y
    {
    }
}
$server->setClass("bar"$arg1$arg2);

?>



add a note add a note User Contributed Notes
SoapServer->setClass
Ariz Jacinto
05-Dec-2008 12:38
If you want your SOAP client to be able to save and then retrieve the object properties, you need to set the SOAP server to be persistent by setting session.auto_start=0, invoking session_start(), and SoapServer->setPersistence(SOAP_PERSISTENCE_SESSION) in the following manner:

<?php
 
//set ini
 
ini_set("soap.wsdl_cache_enabled", 0);
 
ini_set("session.auto_start", 0);

 
//class file
 
require_once('MyClass.php');

 
//for persistent session
 
session_start();

 
//service
 
$server = new SoapServer('service.wsdl');
 
$server->setClass("MyClass");
 
$server->setPersistence(SOAP_PERSISTENCE_SESSION);
 
$server->handle();
?>
info at adaniels dot nl
07-Mar-2008 12:46
A method SoapServer::setObject($object) also exists. This is for some reason not documented.

SoapServer->setPersistence> <SoapServer->handle
Last updated: Fri, 26 Dec 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites