Re: [SOAP] Help with .NET client

From: Date: Thu, 17 Jul 2003 14:10:41 +0000
Subject: Re: [SOAP] Help with .NET client
References: 1 2 3 4  Groups: php.soap 
Request: Send a blank email to php-soap+get-840@lists.php.net to get a copy of this message
On Thu, Jul 17, 2003 at 10:04:41AM +0200, Dmitri Vinogradov wrote: > Hi > > could you please post your __tipedef for getConfigResponse and ConfigEntry - > guess there's some namespace issue in it... Sure. Here are the relevant pieces: $this->__typedef['ConfigEntry'] = array('srcHost' => 'string', 'srcPort' => 'int', 'dstHost' => 'string', 'dstPort' => 'int' ); $this->__dispatch_map['getConfig'] = array('in' => array('inputString' => 'string'), 'out' => array('outputStruct' => '{urn:rinetd}ConfigEntry') ); later (following the structure and layout of the disco_server example) is: $server = new SOAP_Server; $server->_auto_translation = true; $Rinetd_Server = new rinetd(); $server->addObjectMap($Rinetd_Server,'urn:rinetd'); When I generate a wsdl for it, I get warnings at the top of the wsdl like this: <br> <b>Warning</b>: Invalid content of \{\} in <b>/usr/share/pear/SOAP/Disco.php</b> on line <b>338</b><br> and the generated wsdl for the getConfig action looks like this: <message name="getConfigResponse"> <part name="outputStruct" type="tns:" /> </message> If I change my dispatch map to this: $this->__dispatch_map['getConfig'] = array('in' => array('inputString' => 'string'), 'out' => array('outputStruct' => 'ConfigEntry') ); then it generates <message name="getConfigResponse"> <part name="outputStruct" type="xsd:ConfigEntry" /> </message> Which I suppose is as expected. For a while, I was just hand-fixing the wsdl. At this point, I could see what was wrong, but didn't want to have to figure out how the wsdl generation stuff worked, so I blindly changed Disco.php as follows. It's probably wrong, but It Works For Me (tm), and I'll keep using it until you give me an official patch. :) --- SOAP-old/Disco.php Wed Jul 16 07:32:05 2003 +++ SOAP/Disco.php Thu Jul 17 07:31:29 2003 @@ -327,7 +327,7 @@ } function _getTypeNs($type) { - preg_match_all("'\{(.*)\}'sm",$type,$m); + preg_match_all("'\{(.*)\}(.*)'sm",$type,$m); if (isset($m[1][0]) && $m[1][0] != '') { if (!array_key_exists($m[1][0],$this->namespaces)) { $ns_pref = 'ns' . count($this->namespaces); @@ -335,7 +335,7 @@ $this->_wsdl['definitions']['attr']['xmlns:' . $ns_pref] = $m[1][0]; } $typens = $this->namespaces[$m[1][0]]; - $type = ereg_replace($m[0][0],'',$type); + $type = $m[2][0]; } else { $typens = 'xsd'; } Thanks. -- Ron Pedde ron@corbey.com

« previous php.soap (#840) next »