Pear::SOAP and bindWSDL (formerly "bind") -- Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I apologize for the length of the following post, but I wanted to make
things as clear as I could.  Hopefully I've succeeded :)

Using Pear::SOAP, has anyone been able to get the "bindWSDL" (formerly
"bind") function to work such that a server can use a WSDL file to
validate a request from a client.  Specifically, I would like to be
able to do the following:

<?php
require_once('SOAP/Server.php');

class MyClass{
    // MyClass does not call __dispatch_map
    // or __dispatch.  This is deliberate
    // because I want the wsdl file to do
    // the work for me to validate the
    // client request.

    function myFunc($param1, $param2){
        . . .
    }
}

$server = new SOAP_Server();
$myclass = new MyClass();
$server->bindWSDL('my.wsdl');
$server->service($HTTP_RAW_POST_DATA);
?>

One thing that seems to be missing in my code is a binding between the
server object and the class object, i.e., something like
$server->setObject($myclass).  (In case it's not clear, setObject is a
name I made up.)  Otherwise, how does the server compare the
implementation of myFunc in MyClass to the definition of myFunc in
my.wsdl?

Whenever I call this code I get the following error: "method myFunc
not defined in service".  So, either (a) I'm doing something wrong or
(b) bindWSDL is not intended to do what I want it to do.

The following code works but requires that I call __dispatch_map and
__dispatch if I want to properly validate the client request.

<?php
require_once('SOAP/Server.php');

class MyClass{
    function MyClass() {
        $this->__dispatch_map['myFunc'] = . . .

    function __dispatch($methodname) . . .

    function myFunc($param1, $param2){
        . . .
    }
}

$server = new SOAP_Server();
$myclass = new MyClass();
$server->addObjectMap($myclass, 'urn:MyClass');
$server->service($HTTP_RAW_POST_DATA);
?>

I have searched extensively in an attempt to find an answer to my
question, but so far without success.  If anyone out there can help me
that would be fantastic.

Thanks very much.

Jon.

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux