SOAP empty response. Apparently good request.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nickgiles
Forum Newbie
Posts: 1
Joined: Mon Feb 02, 2009 1:14 pm

SOAP empty response. Apparently good request.

Post 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
Last edited by nickgiles on Tue Feb 03, 2009 2:14 am, edited 1 time in total.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Re: SOAP empty response. Apparently good request.

Post 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)
Post Reply