Issues (209)

samples/wsdlclient3b.php (7 issues)

1
<?php
2
/*
3
 *	$Id: wsdlclient3b.php,v 1.1 2004/06/15 15:38:29 snichol Exp $
4
 *
5
 *	WSDL client sample.
6
 *
7
 *	Service: WSDL
8
 *	Payload: rpc/encoded (params as an XML string; cf. wsdlclient3.php)
9
 *	Transport: http
10
 *	Authentication: none
11
 */
12
require_once('../lib/nusoap.php');
13
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
14
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
15
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
16
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
17
$client = new soapclient('http://www.scottnichol.com/samples/hellowsdl2.php?wsdl', true,
0 ignored issues
show
true of type true is incompatible with the type null|array expected by parameter $options of soapclient::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
$client = new soapclient('http://www.scottnichol.com/samples/hellowsdl2.php?wsdl', /** @scrutinizer ignore-type */ true,
Loading history...
18
						$proxyhost, $proxyport, $proxyusername, $proxypassword);
0 ignored issues
show
The call to soapclient::__construct() has too many arguments starting with $proxyhost. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
$client = /** @scrutinizer ignore-call */ new soapclient('http://www.scottnichol.com/samples/hellowsdl2.php?wsdl', true,

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
19
$err = $client->getError();
20
if ($err) {
21
	echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
22
}
23
$params = '<person xsi:type="tns:Person"><firstname xsi:type="xsd:string">Willi</firstname><age xsi:type="xsd:int">22</age><gender xsi:type="xsd:string">male</gender></person>';
24
$result = $client->call('hello', $params);
25
// Check for a fault
26
if ($client->fault) {
0 ignored issues
show
The property fault does not seem to exist on SoapClient.
Loading history...
27
	echo '<h2>Fault</h2><pre>';
28
	print_r($result);
29
	echo '</pre>';
30
} else {
31
	// Check for errors
32
	$err = $client->getError();
33
	if ($err) {
34
		// Display the error
35
		echo '<h2>Error</h2><pre>' . $err . '</pre>';
36
	} else {
37
		// Display the result
38
		echo '<h2>Result</h2><pre>';
39
		print_r($result);
40
		echo '</pre>';
41
	}
42
}
43
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
0 ignored issues
show
The property request does not exist on SoapClient. Did you mean __last_request_headers?
Loading history...
44
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
0 ignored issues
show
The property response does not exist on SoapClient. Did you mean __last_response_headers?
Loading history...
45
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
0 ignored issues
show
The property debug_str does not seem to exist on SoapClient.
Loading history...
46
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
47