logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Printing the Soap Request: msg#00050

Subject: Re: Printing the Soap Request
If you look at the client samples for NuSOAP, you will see that after the 
call(), they have code like this:

// Check for a fault
if ($client->fault) {
 echo '<h2>Fault</h2><pre>';
 print_r($result);
 echo '</pre>';
} else {
 // Check for errors
 $err = $client->getError();
 if ($err) {
  // Display the error
  echo '<h2>Error</h2><pre>' . $err . '</pre>';
 } else {
  // Display the result
  echo '<h2>Result</h2><pre>';
  print_r($result);
  echo '</pre>';
 }
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . 
'</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) 
. '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) 
. '</pre>';

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "john kilbride" <jkilbride@xxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, September 12, 2005 2:14 PM
Subject: [Nusoap-general] Printing the Soap Request


Hi
 I've implemented the nusoap example from zend.com <http://zend.com> but 
would like to examine the contents of the SOAPrequest. 
The code im using is as follows, just before i print out the response i 
would like to print out a copy of the request.
 Does anyone know of a nusoap method that will do this?
  
<html> 
<head> 
<title>Tax calculator Client</title> 
</head> 
<body> 
<h1>Tax calculated:</h1> 
<?php 
/** 
* taxCalcClient.php 
* An example PHP script which uses NuSOAP to access 
* a tax calculator function. 
* 
* Created on August 7, 2002, 6:11 PM 
* @author Sean Campbell 
* @version 1.0 
*/ 

/* Include the NuSOAP library. */ 
require_once('nusoap.php'); 

/* Initialize the client's parameter list. */ 
$param = array('rate' => $_GET['rate'], 
'sub' => $_GET['sub'] 
); 
print"<pre>";
print_r($param);

/* Create a new client by providing the endpoint to the 
* constructor. */ 
$client = new soapclient( 
'http://127.0.0.1/daft/SoapSample/taxCalc.php' 
); 

/* Call the taxCalc() function, passing the parameter list. */ 
$response = $client->call('taxCalc', $param); 

/* handle any SOAP faults. */ 
if ($client->fault) { 
echo "FAULT: <p>Code: {$client->faultcode}<br />"; 
echo "String: {$client->faultstring}"; 
} else { 
echo "$" . $response; 
} 
?> 
</body> 
</html>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>