11-07-2011 08:35 PM
I did a sample step by step by BlackBerry Web Services for Enterprise Administration Getting Started Guide document, but has an error "HTTP response '401: Unauthorized' when communicating with https://MYSERVER:3443/enterprise/admin/ws", but the user can login webconsole use blackberry administation service, I use BlackBerry Enterprise Server Express for Microsoft Exchange 5.0.3, any solution?
Solved! Go to Solution.
11-08-2011 08:35 AM
Hi and welcome to the forums!
Are you using an active directory or BAS user? The sample was only created to handle BAS users.
Another possible cause, does the user have permission to perform the action where the 401 is returned? What line results in the HTTP 401?
11-08-2011 10:27 PM - edited 11-08-2011 11:45 PM
Thanks for reply. I use BAS user, log the web console works fine. And the use has all roles and in all groups,but has error like this "HTTP response '401: Unauthorized' when communicating with https://MYSERVER:3443/enterprise/admin/ws" in this line GetUsersResponse response = _bws.getUsers(request),
GetUsersRequest request = new GetUsersRequest();
request.setMetadata(_meta); // Assign our Metadata to the call
// This criteria object could be used to specify search parameters
GetUsersSearchCriteria searchCriteria = new GetUsersSearchCriteria();
GetUsersSortBy sortBy = new GetUsersSortBy();
GetUsersResponse response = _bws.getUsers(request);
11-09-2011 08:29 AM
What does your encoded username look like for this user?
Could you go in to the BAS console, open the user that you are using with BWS and take a screenshot of their information page including the "Authentication type" information and post back to this thread?
11-09-2011 08:22 PM
Display name: bwsadmin User ID: 7
Authentication type User name Password
BlackBerry Administration Service bwsadmin ********
11-10-2011 07:33 AM
It looks like your username is being encoded incorrectly. I'm assuming "myserver" is the domain? The domain is only needed if using Active Directory, using it without would cause the 401, assuming you have no BAS user with the name "bwsadminmyserver". If you need help investigating the code to fix this then please post the snippet where you set up your GetEncodedUsernameRequest object.
11-10-2011 07:48 PM
Problem resolved！ I removed the setDomain code as bellow by your hint. It works fine. Thanks a lot!
GetEncodedUsernameRequest request = new GetEncodedUsernameRequest();
01-29-2014 10:58 PM
I am facing same issue. am not usng setDomain().
I am trying to connect with our BES server pragmatically to get info like users and policies etc. Our enterprise server version is 5.03. I have created client classes as per RIM documentation using CXF 1.6.1 after downloading certificate. I downloaded simple example from RIM site to test the service calls. I am using authtication type "BlackBerry Administration Service".
I am able to make calls with BWSUtil like, getLocale and authentcators etc. But for any call with BWS like getInfo, getusers throws 401: "Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '401: Unauthorized' when communicating with https://EC2AMAZ-E2037Y4.NTTDATAMOBILELAB.COM/enter
am using admin credentials for testing.
I noticed in log encoded user name put 00 at then end like: "8,0,0,1,1,0;besadmin00"
Any idea whats wrong here?