Service Interfaces
Previous articles have shown how easily MANASYS Jazz can create web services. By this stage we have created a COBOL web service and binding so that it communicates with the outside world with JSON, we have message definitions that comply with the Swagger specification, and we've used ReadyAPI to show the service running. Now it's time to think about developing the client app. The ReadyAPI test hinted that this could be complicated.
App developers want something simple. They'd like to avoid thinking about the mechanics of accessing the web service, and the detailed rules of the fields and processes that must be followed, yet their app must know these details. The details must be consistent with the rules understood by the COBOL web service. And the rules may change! These problems are easily resolved by creating a service interface containing these rules.
If this is your first such interface, you need to create a suitable Visual Studio project. Use template ASP.NET Core Web Application. This makes it possible for you to develop your client app for Windows, IOS, Android, Linux... incorporating the service interface, using your language of choice (Java, C#, VB, etc.). Now, to create the service interface, with your web service displayed in the Jazz workbench, click the [Client] button.
领英推荐
MANASYS combines JSON and Jazz information to generate a C# interface that encapsulates all the rules of the service into a service interface. This interface deals with sending and receiving messages and managing rules like "Update must return Checksum from the Enquiry". The real client app - written in Java, VB, C#, or whatever you use - only has to access properties and methods. It won't even see hidden data like Checksum. When it assigns values to a property the data will be instantly validated by the rules encapsulated in the interface. For example, any PHONE value must be numeric, any SEX value must be M or F.
Click here to see a Help page describing service interfaces in detail. Click here to see the interface JSPG2Client generated to support service JSPG2.
In the next article we'll cover the final step, writing the client app that users see.
See our web page if you want more information about MANASYS Jazz and to see what it can do. Contact us if you have any questions, or connect with us on LinkedIn. Download a free evaluation copy to try out MANASYS Jazz yourself. And if you haven't done so already, please repost the link to this series of articles to your colleagues and contacts.