Instantiate SOAP Request Objects

From: Date: Mon, 01 Jun 2009 12:20:15 +0000
Subject: Instantiate SOAP Request Objects
Groups: php.general 
Request: Send a blank email to php-general+get-293415@lists.php.net to get a copy of this message
Hey, I would like to know how I can instantiate the types that I get via the __getTypes() function or know if this is even possible. I am asking because I have a webservice in which all functions expect an specific object to be passed to them, rather than a list of arguments. And I am hoping that I do not have to code all those objects into my PHP Code, but rather instantiate them kinda from the wsdl! Here is what I have:
    $map = array('Credentials' => 'Credentials', 'GetSourceTextRequest' => 'GetSourceTextRequest');
    $ws = new SoapClient('http://192.168.0.1:8080/Service?wsdl', array('classmap' => $map));
    $test = new GetSourceTextRequest();
It does not work this way however, I do get a class not found failure. How can I instantiate an object from SOAP? __getTypes() gives me something like this: struct Credentials { string Password; string Username; } Any hints would be appreciated! Regards, Samy

« previous php.general (#293415) next »