Kumpf, Roger | 7 Dec 2009 19:20
Picon
Favicon

RE: Getting exceptions from CIMClient::connect()

Tim,

It looks like you have identified a defect in the client library.  Can you capture the raw response from the
server to verify that a 401 Unauthorized status is being returned?  (You can do this by enabling XmlIO
tracing on the server.  Or, if that is not an option, try compiling the client library to enable client-side tracing.)

Then you can create a Bugzilla report including this data.

-Roger

-----Original Message-----
From: Gross, Tim (Utility Computing Architect) 
Sent: Monday, December 07, 2009 7:44 AM
To: Kumpf, Roger; pegasus-l <at> openpegasus.org
Subject: RE: Getting exceptions from CIMClient::connect()

Roger, Kirk, et al:
That is precisely what I am doing, namely:

try {
client.enumerateInstances(...);
}
catch( CIMClientHTTPErrorException& e )
{
...  //errorCode IS available with this class
}
catch( CIMException& e )
{
...
}
catch( Exception& e )
{
... //errorCode IS NOT available with this class 
}

When I execute this code, the last catch ( Exception& e) is where I catch the error.  The problem is that there
is no errorCode available in the Exception class.  I don't understand why a CIMClientHTTPErrorException
is not being thrown instead.

Any ideas?
Tim.

> -----Original Message-----
> From: Kumpf, Roger 
> Sent: Friday, December 04, 2009 2:54 PM
> To: Gross, Tim (Utility Computing Architect); 
> pegasus-l <at> openpegasus.org
> Subject: RE: Getting exceptions from CIMClient::connect()
> 
> Tim,
> 
> The username/password credentials are not validated on 
> connection.  Rather, they are used on each subsequent 
> operation.  You can cause the credentials to be validated by 
> performing an operation.  Choose a basic getClass or 
> something.  Unfortunately, there isn't a universal basic sort 
> of operation to recommend.  (If there were, 
> CIMClient::connect() could just do it!)
> 
> Can you test for authentication failure by catching 
> CIMClientHTTPErrorException and checking if the statusCode is 401?
> 
> -Roger
> 
> -----Original Message-----
> From: Gross, Tim (Utility Computing Architect)
> Sent: Friday, December 04, 2009 2:11 PM
> To: pegasus-l <at> openpegasus.org
> Subject: Getting exceptions from CIMClient::connect()
> 
> Hello all,
> I have never been able to get Pegasus CIMClient::connect() to 
> throw an exception when I pass in invalid credentials.  I 
> would expect it to do so, but instead, it succeeds.  When I 
> try to do some additional calls like 
> CIMClient::enumerateInstances(), I do get an exception, but 
> it is not reliably identifying the bad credentials.  Does 
> anybody have an idea how to handle this better?
> Thanks,
> Tim.
> 
> 


Gmane