NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How to debug NUSOAP Server side scripts


Joined: 08 Dec 2008
Posts: 35
Reply with quote
I have searched the forums repeatedly and either missed completely any posts related to this or they do not work. I can connect to eh server code just fine but when I try to process the data on the server, it is not working. I am trying to debug the code but cannot get it to stop in the server script. I tried the DebugBreak(); in the server but I get the strange message: "looks like we got no XML document". I can find no way to debug the server.

Can anyone help?

I am using nusoap as my soap server with the following code:

Code:

<?php

require_once('lib/nusoap.php');
//require_once('fvsoap.php');
 
$NTS_soapserver = new nusoap_server();//nusoap_server;
 
$NTS_soapserver->configureWSDL('NTS_soapserver', 'urn:NTS_soapserver');
 
$NTS_soapserver->wsdl->schemaTargetNamespace = 'urn:NTS_soapserver';
DebugBreak();
$NTS_soapserver->register('NTSServer_Notes',
            array('id' => 'xsd:int', 'key'=>'xsd:int', 'notes'=>'xsd:string'),
            array('return' => 'xsd:string'),
            'urn:NTS_soapserver',
            'urn:server#NTSServer_Notes');
$NTS_soapserver->register('NTSServer_Shipment',
            array('id' => 'xsd:int', 'key'=>'xsd:int', 'shipmentDetail'=>'xsd:string'),
            array('return' => 'xsd:string'),
            'urn:NTS_soapserver',
            'urn:NTS_soapserver#NTSServer_Shipment');
$NTS_soapserver->register('NTSServer_PU',
            array('id' => 'xsd:int', 'key'=>'xsd:int', 'PUDetail'=>'xsd:string'),
            array('return' => 'xsd:string'),
            'urn:NTS_soapserver',
            'urn:server#NTSServer_PU');
 
    function NTSServer_Shipment($arr){
        include_once ($_SERVER['DOCUMENT_ROOT'].'/truck/inc/fvsoap.inc.php');
        $id = $arr['id'];
        $key = $arr['key'];
        $xml = $arr['shipmentDetail'];
        $fv = new fvsoap($id, $key);
       
        if($fv->access){
            return '<?xml version="1.0"?><LABEL>(id ='.$id.', key='.$key.') The value of the server poll resulted in good information</LABEL>';
        }
        else{
            return '<?xml version="1.0"?><LABEL>(id ='.$id.', key='.$key.') The value of the server poll showed poor information</LABEL>';
        }
    }
    function NTSServer_Notes($id, $key, $notes){
        include_once ($_SERVER['DOCUMENT_ROOT'].'/truck/inc/fvsoap.inc.php');
        if($id > 0)return '<?xml version="1.0"?><LABEL>The value of the server poll resulted in good information</LABEL>';
        else return '<?xml version="1.0"?><LABEL>The value of the server poll showed poor information</LABEL>';
    }
    function NTSServer_PU($id, $key, $PUDetail){
        include_once ($_SERVER['DOCUMENT_ROOT'].'/truck/inc/fvsoap.inc.php');
        if($id > 0)return '<?xml version="1.0"?><LABEL>The value of the server poll resulted in good information</LABEL>';
        else return '<?xml version="1.0"?><LABEL>The value of the server poll showed poor information</LABEL>';
    }
 
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
 
$NTS_soapserver->service($HTTP_RAW_POST_DATA);
?>


I am trying to access the soap server with the following (same machine):
Code:

                $xml = '<some valid xml>';
                $url = 'http://localhost/truck/soap/NTS_soapserver.php?wsdl';
                $params   = array(
                        'id'                => 488,
                        'key'               => 63537,
                        'shipmentDetail'    => $xml,
                );
                try{
                    ini_set('soad.wsdl_cache_enabled',0);
                    $result = @new SoapClient($url, array("trace" => 1, "exception" => 0)); //SoapClient($url);
                    $functions = $result->__getFunctions();
                   
                    $responseXML = $result->NTSServer_Shipment($params);
                    $response = simplexml_load_string($responseXML);
                    if(isset($response['NTS']['ERROR_LIST'])){
                       $result = 'SOAP Execution FAILED for an unspecified reason!';
                    }
                    else (isset($response['NTS']['LABEL'])){
                        $result = 'SOAP Execution was SUCCESSFULL!';
                    }
                    $retval = true;
                }
                catch(SoapFault $e){
                    echo $e->faultstring;
                    $retval = false;
                    $result = 'SOAP Execution FAILED for an unspecified reason!';
                }
                break;
View user's profileFind all posts by radi8Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
probably you have to add DBGSESSID=1@yourClientIPaddres to the WSDL url in your client script:

$url = 'http://localhost/truck/soap/NTS_soapserver.php?wsdl&DBGSESSID=1@127.0.0.1';

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to debug NUSOAP Server side scripts
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic