Web services example
JCICS supports all API commands that are available for working with web services in an application.
For information about the JCICS classes and methods that support web services, see JCICS API mapping to EXEC CICS API.
To handle the application data that is sent and received in a web service request, if you are working with structured data, you can use a tool such as IBM® Record Generator for Java to generate classes. See Interacting with structured data from Java. You can also use Java to generate and consume XML directly.
Example
The following example shows how you might use JCICS to create a web service request:
Channel requesterChannel = Task.getTask().createChannel("TestRequester");
Container appData = requesterChannel.createContainer("DFHWS-DATA");
byte[] exampleData = "ExampleData".getBytes();
appData.put(exampleData);
WebService requester = new WebService();
requester.setName("MyWebservice");
requester.invoke(requesterChannel, "myOperationName");
byte[] response = appData.get();