Using the
CICS®
JSON
assistant, you can create a service provider application from a JSON
schema.
Before you begin
Before you can create a service provider application, the
following conditions must be satisfied:
- Your web services description must be in a
UNIX
file in
z/OS®
and
you must create a suitable provider mode pipeline in the
CICS
region.
- You must define to OMVS the user ID under which DFHJS2LS runs.
- The user ID must have read permission to
z/OS
UNIX
and
PDS libraries and write permission to the directories specified on
the
LOGFILE
,
WSBIND
, and
JSON-SCHEMA-REQUEST
,
JSON-SCHEMA-RESPONSE
,
and
JSON-SCHEMA-RESTFUL
parameters.
- You must allocate sufficient storage to the user ID for the ID
to run
Java™
. You can use any
supported version of
Java
. By
default, DFHJS2LS uses the
Java
version
specified in the
JAVADIR
parameter.
About this task
You can use the JSON assistant to create language structures
from your JSON schema for the service provider application.
Procedure
- Use the DFHJS2LS batch program to generate a web
service binding file and one or more language data structures. DFHJS2LS contains a large set of optional parameters that
provide
you with flexibility to create the binding file and language
structures
that your application requires. Consider these options when you enable
an existing application for web services:
- Which mechanism will
CICS
use
to pass data to the service provider application program? You can
use channels and pass the data in containers or use a COMMAREA.
Channels
and containers are recommended. Specify them with the
PGMINT
parameter.
- Which language do you want to generate? DFHJS2LS can generate
COBOL, C/C++, or PL/I language data structures. Specify the
language
using the
LANG
parameter.
- Which mapping level do you want to use? The higher the mapping
level, the more control and support you have available for the
handling
of character and binary data at run time. Some optional parameters
are available only at the higher mapping levels. You are
recommended
to use the highest level of mapping available. Specify the mapping
level with the
MAPPING-LEVEL
parameter.
- Which URI do you want the web service requester to use? Specify
a relative URI using the
URI
parameter; for example,
URI=/my/test/webservice.
The value is used by
CICS
when
it creates the URIMAP resource.
- Under which transaction and user ID will you run the web service
request and response? You can use an alias transaction to run the
application to compose a response to the service requester. The
alias
transaction is attached under the user ID. Specify it with the
TRANSACTION
and
USERID
parameters.
These values are used when creating the URIMAP resource. If you do
not want to use a specific transaction, do not use these parameters.
When you submit DFHJS2LS,
CICS
generates the web service binding file
and places it in the location that you specified with the
WSBIND
parameter.
The language structures are placed in the partitioned data set that
you specified with the
PDSLIB
parameter.
- Copy the generated web service binding file to the
pickup
directory
of the provider mode PIPELINE resource that you want to use for your
web service application.
You must copy the binding file
in binary mode.
- Write a service provider application program to interface
with the generated language structures and implement the required
business logic.
- Use the
PIPELINE SCAN
command to dynamically
create the WEBSERVICE resource and a URIMAP resources.
- The WEBSERVICE resource encapsulates the web service binding file
in
CICS
and is used at run
time.
- The URIMAP resource provides
CICS
with
the information to associate the WEBSERVICE resource with a specific
URI.
Alternatively, you can define the resources yourself, although
this is not recommended.