Page 1 of 1

SOAP empty response. Apparently good request.

Posted: Mon Feb 02, 2009 1:56 pm
by nickgiles
Hi Guys,

I'm attempting to consume a web service using SOAP. I'm creating the SOAP client with a trace and I'm using getLastRequest and getLastResponse. My request looks good but my response looks empty. I'm a bit stuck as to what to do to debug further. Does anybody have any suggestions? The following is the function from which I'm instantiating and then using the SOAP client.

Code: Select all

 
<?php
ini_set('display_errors', 1);
 
$params = array ();
$params [0] ["application_id"] = 206;
$params [0] ["language_id"] = 'en';
$params [0] ["content_types"] = 'ringtones';
$params [0] ["search_term"] = 'Sex & The City';
$params [0] ["page_size"] = 10;
$params [0] ["page_num"] = 2;
 
function getSearchResultsByCategory ($params){
    
try {
    
    $client = new SoapClient ( NULL, 
 
    array (
 
    'location' => "http://precontentapi.rackspace/newSearch.php", 
    //'uri' => "http://schemas.xmlsoap.org/wsdl/",
    'uri' => "http://schemas.xmlsoap.org/soap/encoding/",
    'trace' => 1 )
 
     )
 
    ;
 
    $response = $client->__soapCall ( 'search', $params );
    
    echo "REQUEST:\n" . $client->__getLastRequest() . "<br/>";
    echo "RESPONSE:\n" . $client->__getLastResponse() . "<br/>";
 
    echo print_r('response Start-- '.$response.'--response End',true);
 
} catch ( Exception $e ) {
    
    printf ( "Message = %s\n", $e->__toString () );
 
} // try
}
 
getSearchResultsByCategory ($params);

My out put from the function above is this below.

REQUEST: application_id206language_idencontent_typesringtonessearch_termSex & The Citypage_size10page_num2
RESPONSE:
response Start-- --response End

Re: SOAP empty response. Apparently good request.

Posted: Mon Feb 02, 2009 6:07 pm
by Citizen
To get help here, start by:

1. using the code tags so that we can distinguish your code from your text
and
2. use some sort of code format to make it easier to read (which will probably make it easier for you to spot mistakes as well)