Hi all,
I have a big problem trying to connect a webservice developed in .NET,
the client (PHP:PEAR:SOAP and NuSOAP) both return this error code:
Object reference not set to an instance of an object.
Searching in Google, it's may a problem with PHP and .NET especified. I
don't know if someone have this problem too and how to solve it. I'll
very thanksful for some idea about this.
Looking again in Google, i found this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;810098
I see is a know bug, but I can't install the .NET framework, becouse my
client machine is Linux, but I'm not absoluty sure about this issue.
My Code in the two versions:
<?php
require_once("SOAP/Client.php");
$client = new SOAP_Client('http://xxxxxx/wsXXXxxx/ws_xxxxx.asmx?WDSL');
$params = array(
'pin_RUT' => "10220078",
'strnombre' => '',
'strpaterno' => '',
'strmaterno' => ''
);
$response = $client->call('Busca_RutTitular', $params,
'','http://tempuri.org/ws_Portal_ATec/ws_Clinicas/Busca_RutTitular');
print_r($response);
?>
And with NuSOAP:
<?php
require_once('nusoap/lib/nusoap.php');
$client = new soapclient("http://xxxxxxx/wsXXX/ws_xxxxx.asmx", true);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$params = array(
'pin_RUT' => "10220078",
'strnombre' => "",
'strpaterno' => "",
'strmaterno' => ""
);
$result = $client->call('Busca_RutTitular', $params, "",
"http://tempuri.org/ws_Portal_ATec/ws_Clinicas/Busca_RutTitular");
if ($client->fault) {
echo '<h2>Fault (This is expected)</h2><pre>'; print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
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->debug_str,
ENT_QUOTES) . '</pre>';
?>
That's all. Thanks a lot in advanced for any help, and sorry for my english.
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php