we got a wsdl file from our Graydon company colleagues, we need to be able to search en retrieve info from their server, like Search for Company Name and get all info about that Company.
WSDL: http://www.graydon.be/schemas/portal/1.0/wsdl/portal.wsdl
REQUEST [connect.php]
<?php
error_reporting(-1);
ini_set('display_errors', 1);
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$client = new SoapClient("http://www.graydon.be/schemas/portal/1.0/wsdl/portal.wsdl");
if (isset($_POST['ciaNumber'])){
$ciaNumber = $_POST['ciaNumber'];
}
if (!isset($_POST['submit'])) {
?>
<html>
<head>
<title>GRAYDON</title>
</head>
<body>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
VAT: <input type="text" size="20" maxlength="20" name="ciaNumber"><br /><br />
<input type="submit" value="submit" name="submit">
</form>
<?php
} else {
$result = $client->SearchByCompanyNumber(array("SearchByCompanyNumber"=>array("Number"=>"$ciaNumber", "CountryCode"=>"BE")));
$array = $result->SearchByCompanyNumberResult->SearchByCompanyNumber;
echo "table border='2'>
<tr>
<th>Number</th>
<th>Country Code</th>
</tr>
";
foreach ($array as $k=>$v){
echo "<tr>
<td align='right'>" . ($k+1) . "</td>
<td>" . $v->Number . "</td>
<td align='right'>" . $v->CountryCode . "</td>
</tr>";
}
echo "</table>";
}
?>
OK, with this I’m trying to retrieve info about given Company number, any suggestions?
I’m getting following errors
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no ‘Number’ property in C:\inetpub\wwwroot\graydon\graydon.php:30 Stack trace: #0 C:\inetpub\wwwroot\graydon\graydon.php(30): SoapClient->__call(‘SearchByCompany…’, Array) #1 C:\inetpub\wwwroot\graydon\graydon.php(30): SoapClient->SearchByCompanyNumber(Array) #2 {main} thrown in C:\inetpub\wwwroot\graydon\graydon.php on line 30