Re: Why is response type NOT as specified in WSDL?

From: Date: Mon, 18 Jul 2011 13:26:08 +0000
Subject: Re: Why is response type NOT as specified in WSDL?
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-3327@lists.php.net to get a copy of this message
Justin, the class certainly is defined (in a separate file that I require_once at the beginning of the client. As this is a development machine, I have cache configured to NONE. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!class_exists("InsertIDResponse")) { /** * InsertIDResponse */ class InsertIDResponse { /** * @access public * @var integer */ public $out; public function InsertIDResponse ($code) { $this->out = $code; } } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Richard, here is the entire SoapClient class. I adapted a tutorial I found online. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!class_exists("TestClient")) { class TestClient extends SoapClient { /** * Default class map for wsdl=>php * @access private * @var array */ private static $classes = array( "InsertIDResponse" => "InsertIDResponse", "Person" => "Person", ); /** * Constructor using wsdl location and options array * @param string $wsdl WSDL location for this service * @param array $options Options for the SoapClient */ public function __construct ($wsdl="http://localhost/TestSOAP.wsdl") { parent::__construct($wsdl, array ('classmap' => $classes, 'trace' => 1)); } public function _checkArguments($arguments, $validParameters) { $variables = ""; foreach ($arguments as $arg) { $type = gettype($arg); if ($type == "object") { $type = get_class($arg); } $variables .= "(".$type.")"; } if (!in_array($variables, $validParameters)) { throw new Exception("Invalid parameter types: ".str_replace(")(", ", ", $variables)); } return true; } public function InsertID($mixed = null) { $validParameters = array( "(Person)", ); $args = func_get_args(); $this->_checkArguments($args, $validParameters); $result = $this->__soapCall("InsertID", $args); return $result; } }} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I hope this isn't too bothersome. Shmuel-Aharon -- You're just jealous because the voices only talk to me. Shmuel A. Kam Shmuel@Kam-motion.com

« previous php.soap (#3327) next »