ID:               30352
 Comment by:       schow at macnexus dot org
 Reported By:      jiro at email dot it
 Status:           No Feedback
 Bug Type:         SOAP related
 Operating System: Windows XP SP2
 PHP Version:      5.0.3
 Assigned To:      dmitry
 New Comment:

And here is the error in its entirety:

Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] No
Deserializer found to deserialize a ':q' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'. in
/Library/WebServer/Documents/test.php:41 Stack trace: #0 [internal
function]: SoapClient->__call('doGoogleSearch', Array) #1
/Library/WebServer/Documents/test.php(41):
SoapClient->doGoogleSearch(Array) #2 {main} thrown in
/Library/WebServer/Documents/test.php on line 41

Currently using PHP 5.1.6 on Mac OS X.  However, I've tested and gotten
used to wirtesome of the same results on Linux and Windows.


Previous Comments:
------------------------------------------------------------------------

[2006-10-09 06:11:20] schow at macnexus dot org

This might be the extra feedback you're looking for.  I ran across
these symptoms when working with the Google Search SOAP API.

Basically, in WSDL Mode, the Soap Client needs the parameters to the
operations passed to it as individual functions.  Passing an array of
parameters causes a SoapFault Exception.  Naturally, in Non-WSDL mode,
an array of parameters works just fine.

In other words, in WSDL Mode, this works:
$results = $client->doGoogleSearch('[Google Key]', 'Cornbread', 0, 10,
true, '', false, 'english', 'utf-8', 'utf-8');

While this one causes the SOAP Exception:

$params = array('key' => '[Google Key]',
        'q' => 'Cornbread', 
        'start' => 0,
        ...)
$result = $clientWSDL->doGoogleSearch($params);






Here is the script in its entirety:
<?php
//BEGIN PARAMS ARRAY
$params = array('key' => '[A Google Key]',
        'q' => 'Cornbread', 
        'start' => 0,
        'maxResults' => 10,
        'filter' => true,
        'restrict' => 'countryUS',
        'safeSearch' => false,  
        'lr' => 'english',
        'ie' => 'utf-8',
        'oe' => 'utf-8');
//END PARAMS ARRAY

//BEGIN NONWSDL MODE
$clientNonWSDL = new SoapClient(null,
        array('location' => "http://api.google.com/search/beta2";, 
                        'uri' => "urn:GoogleSearch"
        )
);

//WITH PARAMS AS ARRAY
$resultNonWSDL = $clientNonWSDL->__soapCall('doGoogleSearch',
$params);
echo "<h1>NonWSDL Client Request With Array:</h1>";
echo "<h4>REQUEST:\n" . $clientNonWSDL->__getLastRequest() . "</h4>";
var_dump($resultNonWSDL);


//END NONWSDL MODE

//BEGIN WSDL MODE
$clientWSDL = new SoapClient('http://api.google.com/GoogleSearch.wsdl',
array('trace' => true));

//WITH PARAMS AS INDIVIDUAL ITEMS
$resultWSDLNonArray = $clientWSDL->doGoogleSearch('[A Google Key]',
'Cornbread', 0, 10, true, '', false, 'english', 'utf-8', 'utf-8');
echo "<h1>WSDL Client Request With String:</h1>";
echo "<h4>REQUEST:\n" . $clientWSDL->__getLastRequest() . "</h4>";
var_dump($resultWSDLNonArray);

//WITH PARAMS AS ARRAY
$resultWSDLArray = $clientWSDL->doGoogleSearch($params);
echo "<h1>WSDL Client Request With Array:</h1>";
echo "<h4>REQUEST:\n" . $clientWSDL->__getLastRequest() . "</h4>";
var_dump($resultWSDLArray);

//END WSDL MODE
?>

------------------------------------------------------------------------

[2005-02-05 01:00:06] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2005-01-28 12:03:42] [EMAIL PROTECTED]

The error occurs on server side.
Seems server cannot decode the soap request.

To understand (and fix) the problem I need to know the expected soap
request and the actual one.

You can use the following script to catch SOAP request with ext/soap.

<?php
  $queryst="/rdf:RDF/rdf:Description[ns1:subject='$cat']" ;
  $namespaces=array("rdf",
                    "http://www.w3.org/1999/02/22-rdf-syntax-ns#";, 
                    "rdfs", 
                    "http://www.w3.org/2000/01/rdf-schema#";,
                    "ns1", 
                    "http://purl.org/dc/elements/1.0/";, 
                    "ns2", 
                    "http://purl.org/dc/terms/";);
  $soap_client=new
SoapClient('http://jiroland.dyndns.org/QueryService.wsdl',
                              array('trace'=>1,
                                    'exceptions'=>0));
  $response=$soap_client->queryCollection('tbl', $queryst,
true,$namespaces);
  echo $soap_client->__getLastRequest()."\n";
  echo $soap_client->__getLastResponse()."\n";
  var_dump($response);
?>


------------------------------------------------------------------------

[2005-01-03 12:27:07] jiro at email dot it

Sorry, this is the script

http://jiroland.dyndns.org/soap.txt

I tested with PHP 5.0.3 but it's the same

------------------------------------------------------------------------

[2004-12-05 01:00:08] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/30352

-- 
Edit this bug report at http://bugs.php.net/?id=30352&edit=1

Reply via email to