This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
developers:integration:wsa [2018/06/27 14:06] tjotov |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Using ADUCID web service “WSA” ====== | ||
| - | |||
| - | See | ||
| - | * [[developers: | ||
| - | * [[integration-api: | ||
| - | * | ||
| - | For detailed methods / classes / types description see [[http:// | ||
| - | |||
| - | 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: | ||
| - | |||
| - | < | ||
| - | https:// | ||
| - | </ | ||
| - | |||
| - | There you will see WSA Interface homepage where you can download WSDL file to generate client. | ||
| - | |||
| - | < | ||
| - | https:// | ||
| - | </ | ||
| - | |||
| - | |||
| - | ====== C# Example ====== | ||
| - | |||
| - | === Import WSDL into your project in Visual Studio. === | ||
| - | |||
| - | Create an instance of **AducidApiServiceClient **. | ||
| - | |||
| - | === Create a start operation Url === | ||
| - | This page starts authentication request. | ||
| - | |||
| - | <code csharp> | ||
| - | var aducid = new AducidApiJsonServiceClient(); | ||
| - | string host = " | ||
| - | |||
| - | string query = context.Request.QueryString.ToString(); | ||
| - | var queryParsed = HttpUtility.ParseQueryString(query); | ||
| - | var generateQr = queryParsed[" | ||
| - | var arg = new OperationArgument(); | ||
| - | arg.peigReturnName = host + "/ | ||
| - | arg.qrCodePictureHeight = 300; | ||
| - | arg.qrCodePictureWidth = 300; | ||
| - | arg.id = " | ||
| - | arg.generateQrCodePicture = generateQr == " | ||
| - | |||
| - | var response = aducid.startAuthenticationSession(JsonConvert.SerializeObject(arg)); | ||
| - | dynamic responseObj = JsonConvert.DeserializeObject(response); | ||
| - | |||
| - | Console.WriteLine(responseObj.data.authId); | ||
| - | context.Session[" | ||
| - | context.Response.ContentType = " | ||
| - | context.Response.Write(response); | ||
| - | </ | ||
| - | |||
| - | === 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(" | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | sb.Append("< | ||
| - | |||
| - | sb.Append("</ | ||
| - | |||
| - | } | ||
| - | catch (Exception ee) | ||
| - | { | ||
| - | sb.Append(" | ||
| - | } | ||
| - | lResponse.Text = sb.ToString(); | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | === Prepare a web page === | ||
| - | This page should contain [[integration-api: | ||
| - | Provide start, check and proxy Url. | ||
| - | | ||
| - | | ||
| - | | ||