Author Message
KevinKramer
Joined: Aug 18, 2006
Messages: 0
Offline
Has anyone tried consuming the web services using .net 2.0. I am currently working with this but every time I go to invoke a call I get a HTTP status 401: Authorization Required error. This occurs when I make a call to any web service. Using both SSL and non-SSL connections.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hi Kevin,

Can you please tell us which version of AES you are running?

Thanks,
Joel
KevinKramer
Joined: Aug 18, 2006
Messages: 0
Offline
Sorry I thought it said it in the versioning area. We are running 3.1.2
KevinKramer
Joined: Aug 18, 2006
Messages: 0
Offline
Also the preferred way I was trying to connect was by using the UserService rather than connecting to an LDAP server or anything else external, but i get the same kind of error trying to make requests against the UserService as well.
AnthonyGreway
Joined: Feb 12, 2007
Messages: 0
Offline
Kevin,

If you are receiving an "HTTP/1.0 401 Unauthorized: Authentication Required for SMS access" response, then you most likely have not supplied the required login/password in the HTTP Header. See the "Authentication and Session Management" section of the SDK for more information on implementing this.

A side note, you can configure SMS to allow/disallow un-secure connections in the saw.ini configuration file. If you had set "AllowHTTP=false" and used a non secure connection, you would have received an "Access denied: HTTPS required" response.

Tony
TimSchmelmer
Joined: Feb 12, 2007
Messages: 0
Offline
Kevin,

Our web services require that you provide user credentials (login / password) before you can submit requests. For our SMS web service, you need to use a valid Communication Manager account's details. For our Telephony Web Service, you need to use a valid account as administered in AES' LDAP database for User Management.

Here comes some sample code for our SMS service:
SystemManagementService smsService = new SystemManagementService();





smsService.Credentials = new System.Net.NetworkCredential("user1@127.0.0.171", "user1pw");

smsService.PreAuthenticate = true;



smsService.sessionID = new AESTestWS.sms.@string();

smsService.sessionID.Text = new string[1];

smsService.sessionID.Text[0] = this.sessionID;



String objectname = "";

Result result;

try

{

submitRequestType req = new submitRequestType();

req.fields = fields.Text;

req.model = model.Text;

req.objectname = objectname;

req.operation = operation.Text;

req.qualifier = qualifier.Text;

result = smsService.submitRequest(req).@return;

smsService.release(null);



}

catch (Exception ex)

{

results.Text = ex.ToString();

return;

}




Hoping this helps,

Tim

PS: Make sure that you set the PreAuthenticate flag on the web service instance, as is required for all .NET WS clients.
KevinKramer
Joined: Aug 18, 2006
Messages: 0
Offline
Thanks for the help. The problem was that I was leaving out the IP Address in my Credentials definition. I was assuming a 401 error had to be occurring prior to me connecting to the web service.
Go to:   
Mobile view