NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problems access WebService

Joined: 18 Mar 2010
Posts: 1
Reply with quote
I have a problem with NuSoap. My problem is that i can`t connect to a function which is defined on a WSDL. The WSDL is and the code to connect with SOAP is...

// Pull in the NuSOAP code
// Create the client instance
$client = new soapclient('', true);
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
$proxy= $client->getProxy();
//EL USer y el pass no los pongo
$header = '<UserCredentials><userName></userName><passWord></passWord></UserCredentials>';
$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);
$result = $client->call('SearchAccounts',$parametros);
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    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>';
    echo '</pre>';
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';

What fails??

    [faultcode] => soap:Server
    [faultstring] => Server was unable to process request. ---> Object reference not set to an instance of an object.
    [detail] =>

Thanks!!!And sorry about my english...
View user's profileFind all posts by utopiko2Send private message
Problems access WebService
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

 Reply to topic