Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2010, 06:12
utopiko
 
Fecha de Ingreso: marzo-2006
Mensajes: 230
Antigüedad: 18 años, 1 mes
Puntos: 2
Problema con NuSoap

Tengo un problema con NuSoap. El problema es que no puedo conectarme a una funcion definida en un WSDL. El Wsdl es http://www.b-kin.com/bcim/Account/Ac...vice.asmx?WSDL, y el codigo con el que me intento conectar al Soap es el siguiente...

Código PHP:
Ver original
  1. <?php
  2. // Pull in the NuSOAP code
  3. require_once('lib/nusoap.php');
  4. // Create the client instance
  5. $client = new soapclient('http://www.b-kin.com/bcim/Account/AccountService.asmx?WSDL', true);
  6. // Check for an error
  7. $err = $client->getError();
  8. if ($err) {
  9.     // Display the error
  10.     echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  11.     // At this point, you know the call that follows will fail
  12. }
  13.  
  14. $proxy= $client->getProxy();
  15.  
  16. //EL USer y el pass no los pongo
  17. $header = '<UserCredentials><userName></userName><passWord></passWord></UserCredentials>';
  18. $client->setHeaders($header);
  19. $parametros=array('SearchAccounts.searchRequest.Search.CriteriaCollection.SearchCriteria[0].Attribute' => 'Name','SearchAccounts.searchRequest.Search.CriteriaCollection.SearchCriteria[0].CompareOperator' => 'Contains','SearchAccounts.searchRequest.Search.CriteriaCollection.SearchCriteria[0].Value' => 'c','SearchAccounts.searchRequest.Search.SortDirection' => 'ASC','SearchAccounts.searchRequest.Search.Context' => 'All','SearchAccounts.searchRequest.Search.IsForAllUsers' => 'false','SearchAccounts.searchRequest.PageSize' => '0','SearchAccounts.searchRequest.SortField' => 'Name','SearchAccounts.searchRequest.SortOrder' => 'ASC','SearchAccounts.searchRequest.Columns' => 'Name,Email,AccountId','SearchAccounts.searchRequest.CurrentPageIndex' => 0);
  20. $result = $client->call('SearchAccounts',$parametros);
  21. // Check for a fault
  22. if ($client->fault) {
  23.     echo '<h2>Fault</h2><pre>';
  24.     print_r($result);
  25.     echo '</pre>';
  26. } else {
  27.     // Check for errors
  28.     $err = $client->getError();
  29.     if ($err) {
  30.         // Display the error
  31.         echo '<h2>Error</h2><pre>' . $err . '</pre>';
  32.     } else {
  33.         // Display the result
  34.         echo '<h2>Result</h2><pre>';
  35.        print_r($result);
  36.     echo '</pre>';
  37.     }
  38. }
  39. // Display the request and response
  40. echo '<h2>Request</h2>';
  41. echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
  42. echo '<h2>Response</h2>';
  43. echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
  44. // Display the debug messages
  45. echo '<h2>Debug</h2>';
  46. echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
  47. ?>
Que es lo que me puede fallar??El error que me da

Código HTML:
Ver original
  1. Array
  2. (
  3.     [faultcode] => soap:Server
  4.     [faultstring] => Server was unable to process request. ---> Object reference not set to an instance of an object.
  5.     [detail] =>
  6. )

Saludos