User Tools

Site Tools


developers:integration:wsa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:integration:wsa [2018/06/27 14:07]
tjotov
— (current)
Line 1: Line 1:
-====== Using ADUCID web service “WSA” ====== 
- 
-See 
-  * [[developers:basic-overview|Server side integration basics]] 
-  * [[integration-api:start|ADUCID Integration API]] 
-  *  
-For detailed methods / classes / types description see [[http://wiki.aducid.com/client-api|Javadoc SDK Client API]] 
- 
-WSA is meant for all platforms like PHP, C# **except** Java (Java is also possible but we provide a full module so WSDL import is redundant). 
- 
-Web service is a standalone “application” which must be deployed on same server as AIM. Its default address is like this: 
- 
-<code> 
-https://hostname/wsa-json 
-</code> 
- 
-There you will see WSA Interface homepage where you can download WSDL file to generate client. 
- 
-<code> 
-https://hostname/wsa-json?wsdl 
-</code> 
- 
- 
-====== C# Example ====== 
- 
-=== Import WSDL into your project in Visual Studio. === 
- 
-Create an instance of **AducidApiJsonServiceClient**. 
- 
-=== Create a start operation Url === 
-This page starts authentication request. 
- 
-<code csharp> 
-var aducid = new AducidApiJsonServiceClient(); 
-string host = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port; 
- 
-string query = context.Request.QueryString.ToString(); 
-var queryParsed = HttpUtility.ParseQueryString(query); 
-var generateQr = queryParsed["generateQrCodePicture"]; 
-var arg = new OperationArgument(); 
-arg.peigReturnName = host + "/result"; 
-arg.qrCodePictureHeight = 300; 
-arg.qrCodePictureWidth = 300; 
-arg.id = "123"; 
-arg.generateQrCodePicture = generateQr == "true"; 
- 
-var response = aducid.startAuthenticationSession(JsonConvert.SerializeObject(arg)); 
-dynamic responseObj = JsonConvert.DeserializeObject(response); 
- 
-Console.WriteLine(responseObj.data.authId); 
-context.Session["123"] = (string) responseObj.data.authId; 
-context.Response.ContentType = "text/plain"; 
-context.Response.Write(response); 
-</code> 
- 
-OperationArgument is a simple object 
-<code csharp> 
-public class OperationArgument 
-    { 
-        public String peigReturnName { get; set; } 
-        public int qrCodePictureHeight { get; set; } 
-        public int qrCodePictureWidth { get; set; } 
-        public String id { get; set; } 
-        public Boolean generateQrCodePicture { get; set; } 
-    } 
-</code> 
-=== Create check result Url === 
- 
-On the result page we evaluate the authentication request using aducid.getResult 
- 
-There are two basic results – authentication is OK or an error is thrown: 
- 
-<code csharp> 
-protected void Page_Load(object sender, EventArgs e) 
-        { 
-            var queryString = HttpContext.Current.Request.Url.Query; 
-            var query = HttpUtility.ParseQueryString(queryString); 
- 
-            var sb = new StringBuilder(); 
-            var aducid = new AducidApiServiceClient(); 
-            try 
-            { 
-                var result = aducid.getResult(query.Get("authId"), query.Get("authkey")); 
-                sb.Append("<table class=\"table table-bordered\">"); 
-                sb.Append("<tr><td>authId:</td><td>" + result.authId + "</td></tr>"); 
-                sb.Append("<tr><td>authKey:</td><td>" + result.authKey + "</td></tr>"); 
-                sb.Append("<tr><td>operationName:</td><td>" + result.operationName + "</td></tr>"); 
-                sb.Append("<tr><td>UDI:</td><td>" + result.userDatabaseIndex + "</td></tr>"); 
-                sb.Append("<tr><td>Status AIM:</td><td>" + result.statusAIM + "</td></tr>"); 
-                sb.Append("<tr><td>Status auth:</td><td>" + result.statusAuth + "</td></tr>"); 
- 
-                sb.Append("</table>"); 
- 
-            } 
-            catch (Exception ee) 
-            { 
-                sb.Append("Error:" + ee.Message); 
-            } 
-            lResponse.Text = sb.ToString(); 
-        } 
-</code> 
- 
- 
-=== Prepare a web page === 
-This page should contain [[integration-api:start|ADUCID Integration API]]\\ 
-Provide start, check and proxy Url.  
- aducid.setStartOperationUrl("myOpen"); 
- aducid.setResultOperationUrl("myPpenCheck"); 
- aducid.setProxyUrl("myProxy"); 
  
developers/integration/wsa.1530108447.txt.gz · Last modified: 2018/06/27 14:07 by tjotov