You can deploy the J2C application as a web service.
Before you begin
After you have created your J2C application, you can create
a web service for your J2C application.
Procedure
- Open the Web Page, Web Service, or EJB from
J2C bean wizard
- If you are creating a web sService for a J2C bean that exists
in your workspace:
- Select and
click Next.
- On the J2C bean selection page, click Browse to locate your J2C bean. If you know the letter that the name of
your J2C bean starts with, type that letter in the Select
entries field, or type ? to see
a list of all the J2C beans. Highlight your selection and click OK.
Restriction: Illegal XML characters
in IMS™ files:
In order
to improve performance, IMS applications
sometimes substitute trailing spaces for string data types. The most
common characters are x'3F', x'00'. These are perfectly valid when going to a 3270 device or over MSC,
ISC, or other EBCDIC to ASCII applications. However these characters
are invalid according to the XML specification.
x'3F' is the most common example, since the phrase has special meaning
for IMS, but causes problems
to XML. In ASCII, x'3F' translates to a question
mark (?), which is a reserved character in UTF-8, unless properly
handled as part of a string. The IMS/TM adapter treats this character
as an XML delimiter and reports an error at runtime.
Make sure
that your file does not contain these illegal characters, or you get
errors at runtime. To workaround the problem, you can modify the
J2C Java™ Bean implementation
code. Inside your business method, after the invoke method is called,
add a conversion program to convert the output before returning it
to the client application. For example:
... invoke(cs, is, input, output);
//add your own conversion utility here
output = convert(output);
return output;
- Click Next.
- If you have followed the J2C bean wizard to the end, then
on the Deployment Information page, select Create a Web
page, Web Service, or EJB from the J2C bean.
- In the Java EE Resource Type field,
select Web Service, and click Next.
- In the Web Service Project field,
ensure that the correct name of your J2C project appears. If it does
not appear or is not correct, type the correct project name. If you
want to generate the code into a new project, click New.
- Click Advanced if you want to set
advanced properties.
- In the Resource Reference field,
provide a resource reference name. This resource reference maps the
name used in the application to the actual JNDI resource name specified
on the runtime server. Creating a Resource Reference is the preferred
method of managing connections, because it makes your application
code less server dependent. That is, if you want to use a different
server on which to run your application, you can create a Resource
Reference that binds to the new server without needing to change your
application source code. Once you provide a Resource Reference name,
the wizard confirms that the JDNI name exists in the server.
- In the JNDI lookup name field,
ensure that the correct name of your JNDI lookup appears. If it does
not appear or is not correct, type the correct JNDI lookup name.
- If you selected Configure Resource Adapter Deployment on the Deployment Information page, click Next to go specify the RAR settings page. This option is only available
when the connection to the EIS is not purely managed. If the connection
is managed, the RAR deployment to the server is implied.
- If you did not select Configure Resource Adapter
Deployment on the Deployment Information page, click Finish.
- To learn more about creating a web Service, see the web Service documentation.