Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Developing an application that uses the Nexus Card SDK means, from a development point of view, working with XMLs and developing a web service client. This article describes some general basic introduction and approaches to use web services with popular programming languages. The examples used are calling the SDK's web service and its capture dialog.
Expand | |||||
---|---|---|---|---|---|
| |||||
In this service integration the SDK's SOAP interface is called from a simple Windows Forms Application named WindowsFormsTestApp. In our example, we use the approach to integrate the web service as .NET Web Reference and not as Service Reference. According to our experience, this style is easier to handle. But you can also chose to integrate the web service as Service Reference.
To call the capture dialog, enter some code like the following in any method of your application. We use a simple button-triggered event. You may call all other requests of the web service in corresponding way:
The SDK provides the Visual C# example that uses the web service as described here. You can find the examples in the examples directory of the SDK installation. |
Expand | ||
---|---|---|
| ||
Using Java and the web service's SOAP interface, the Java API for XML Web Services (JAX-WS) in combination with the wsimport tool, is usually the first choice to access a web service. API and wsimport tool are part of the JDK package since Version 6. Also Apache Axis can be used. But as Axis requires additional packages, we will only show the wsimport way here. When developing an application using Java, the SOAP way with wsimport generated wrappers may be easier, as the created classes may support the development (provided that Java 6 or higher is used). But you can also use the equivalent RESTful way. |
Expand | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
Using JavaScript is typically used to access a web service from an HTML page in a browser. For this purpose, JavaScript offers the XMLHttpRequest object. This object, which is available in all popular browsers, allows to send and receive data by using HTTP. You can very easily access a service's REST interface in this way. Use this code to start the capture dialog from an HTML in a browser:
Note: The SDK's requests, which show a user interface like the capture dialog, work synchronously. This may cause refresh issues of some browser's main windows (especially the Internet Explorer). Therefore, we recommend to do the request asynchronously as shown in following code:
A last issue when using JavaScript may be caused by caching issues - again typically in combination with the Internet Explorer. An easy but effective workaround is a changing parameter added to the request URL as this code snippet demonstrates:
There are a lot of example code implemented in the HTMLs of the web service's service interface (http://localhost:54880/components.htm and http://localhost:54880/development.htm).
|
Expand | |||||
---|---|---|---|---|---|
| |||||
C or C++ as more low level languages indicate to use the lean implementable REST interface. This is done using the Windows WinINet API to communicate with a peer using HTTP. This code shows the basics to call the capture dialog:
You may use any XML library to retrieve the image data contained in |
Expand | ||
---|---|---|
| ||
We provide several examples demonstrating the usage of the SDK. The examples are intended as supplement to these articles. First of all, use these articles to get a starting point regarding the SDK's basic functionality. The discussions regarding the usage with different programming languages, can be used to get a first approach to start the practical implementation. The examples are intended as a reference implementation for the usage and functionality of the SDK. Feel free to pick those parts from the examples which may be helpful for you. You can find the examples in the examples directory of the SDK installation. |