Re: [SOAP] Help with .NET client
| From: | Dmitri Vinogradov | Date: | Thu, 17 Jul 2003 15:18:41 +0000 |
| Subject: | Re: [SOAP] Help with .NET client | ||
| References: | 1 2 3 4 5 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-841@lists.php.net to get a copy of this message | ||
Hi Ron
Do you get same error if you run disco_server.php example ($Id:
disco_server.php,v 1.3 2003/04/20 23:05:28 shane Exp $)?
If yes - please post what PHP version you have... hm... running
disco_server.php on my box (PHP 4.2.3 / Debian Linux dev 2.4.18-bf2.4)
causes no errors...
Did anyone else got same error within Disco.php?
Regards
DV
"Ron Pedde" <ron@corbey.com> schrieb im Newsbeitrag
news:20030717141041.GA7824@corbey.com...
> 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
>
>