Creating a WSIF interface for the SNA JCA LU62 Connector

If the application uses the WSIF interface to access the SNA JCA LU62 Connector, the connector can be local or remote. The following procedure describes how to create the server proxy, WSDL files, and other steps you need to take to set up an application to use the SNA JCA LU62 Connector through the WSIF interface for outbound messages.

The procedure uses example values that are consistent from step to step to demonstrate the process. Replace the example values with values that are appropriate for your environment. For additional information on any of the steps or fields in the procedure, refer to the WebSphere(R) Studio Application Developer help.

The steps for setting an application up for inbound messages are the same except for small variations such as the name of the operation. Descriptions of the variations follow the procedure.

Before you begin, make sure that the resource adapter for the SNA JCA LU62 Connector is installed. See Installing the SNA JCA LU62 Connector in Application Developer for information.

To create a WSIF interface to the SNA JCA LU62 Connector for outgoing messages:

  1. Create a service project. For example, name the project LU62Sample.
  2. Generate the enterprise service for the application to use:
    1. From the File menu, select New > Service built from.
    2. In the Create Service window, select SNA LU6.2 JCA RESOURCE ADAPTER and click Next.
    3. In the Resource Adapter Properties Service page, type or select values for the connection properties. The following are examples:
      • Outgoing: true
      • SymbolicDestinationName: DSCCRIS0
      • EstablishConversationTimeout: 1000
      • UserNameJCA: userJCA
      • PasswordJCA: passwordJCA
      Use the defaults for the other connection properties.
    4. Click Next.
    5. In the Service Binding page:
      • In the Source folder field, type the path or browse to the service project folder that will contain the generated WSDL files. For example, type /SNALu62Service.
      • In the Package field, type or browse to Java(TM) package for the connector. For example, type sna.lu62.
      • In the Interface file name field, type a name for the interface WSDL file. For example, type test.
      Application Developer generates default values for the other fields based on the interface file name for the other fields.
    6. Click Finish. Completing this step opens the WSDL Editor to the Bindings page. This page contains the bindings contained in the generated WSDL file. If you used the example values, the name of the file is testSNALU62Binding.wsdl.
  3. Add the operations and bindings for the service:
    1. In the Port Type and Binding Operations section, click New beside the Available Operations table to add an operation. You must add the operation before adding its binding definition.
    2. In the Operation Binding page, type the name of the operation into the Operation name field. For example, type OutGoingOp.

      Select whether the operation has a single message (ONE-WAY) or whether the operation has two messages. For the purpose of the example, leave the type of operation as REQUEST_RESPONSE. Select whether the operation has a single message (ONE-WAY) or whether the operation has two messages. For the purpose of the example, leave the type of operation as REQUEST_RESPONSE. Click Next.

    3. In the Binding Properties page, check that the value for the interaction verb is correct. The default value is -1, which corresponds to the SYNC_SEND_RECEIVE verb. This enables the application to send a message to the service and receive its response. If you want the application to only receive messages from the service, set the interaction verb value to 2, which corresponds to the SYNC_RECEIVE verb. If you want the application to send a message to the service but not receive the response, set the interaction verb value to 0, which corresponds to the SYNC_SEND verb. For information on what the verbs do in the connector, see Interaction verbs for the SNA JCA LU62 Connector. For other properties, use the default values. Click Next.
    4. Beside the Input message field, for simple String messages click Browse, or for complex messages click Import.
      If you clicked Browse:
      1. In the dialog that appears, select the service project.
      2. From the Choose a message from a WSDL file drop down list, select the message you want to bind to the operation. For example, select builtin:String.
      3. Click OK.

      If you clicked Import:

      1. In the File Selection Page of the New wizard, select the file that contains the message definitions. If you cannot find the file, try importing the file into Application Developer and then retry this step. The actual steps you will take to import the file depend on the source of the file. Refer to the Application Developer help for more information.
      2. After you have selected the message definition file, click Next.
      3. Select the message you want to bind to the operation. Click Finish.
      4. Click OK.
    5. In Operation Binding page, enable the Use input message for output checkbox. Click Next.
    6. Click Finish.
  4. Generate the service proxy:
    1. Expand the service project (for example, LU62Sample) and then expand the package (for example, sna.lu62).
    2. Right click the service binding file (for example, testSNALU62Service.wsdl) and select Enterprise Services > Generate Service Proxy. The Proxy wizard appears.
    3. In the Service Proxy page, check that the source folder and package name fields are correct. Click Next.
    4. In the Service Proxy Style page, specify the style of the proxy and the operations to expose in the proxy. For example, select the Client stub proxy style. A client stub provides Remote Procedure Call (RPC) style invocation with access to many services. Command bean proxy style invokes a single service but allows you to set properties before execution, and retrieve them afterwards. To continue the example, select the OutGoingOp operation.

      Click Finish.

  5. Generate the deployment code for the enterprise service:
    1. Expand the service project and then expand the package.
    2. Right click the service binding file (for example, testSNALU62Service.wsdl) and select Enterprise Services > Generate Deploy Code. The Generate Deploy Code wizard opens.
    3. Unless you need to change default values, repeatedly click Next until the SOAP Port page appears.
    4. In the SOAP Port page, check that the SOAP port address is correct. It should be the address of the WebSphere Application Server machine on which the connector enterprise service will be deployed or the local host for testing the connection in Application Developer.
    5. Click Finish.
  6. Create the service project for the client such as LU62SampleClient. The client uses the same Java package.
  7. Generate the service client proxy:
    1. Expand the non-client service project (that is, if you use the example values, LU62Sample) and then expand the package.
    2. Right click the service binding file (for example, testSNALU62Service.wsdl) and select Enterprise Services > Generate Service Proxy. The Proxy wizard appears.
    3. In the Service Proxy page, do the following:
      • Change the source folder to /LU62SampleClient
      • Specify the name of the proxy class
      • Check that the package name field is correct

      Click Next.

    4. In the Service Proxy Style page, specify the style of the proxy and the operations to expose in the proxy. For example, select the Client stub proxy style and select the OutGoingOp operation.
    5. Click Finish.

As a result of this procedure, you have created a web service defined by WSDL files and a SOAP Java proxy class that an application can use when sending a message through the SNA JCA LU62 Connector. If you used the example values, the proxy class is Lu62TestClientProxy.java, which Application Developer creates for you. If you selected to use complex messages instead of simple String messages, Application Developer also generates INPUTMSG.java and OUTPUTMSG.java.

To create a WSIF interface to the SNA JCA LU62 Connector for incoming messages, repeat the procedure but make the following changes:

Once you have created the web service and proxy, test them by sending and receiving messages in Application Developer. To send and receive messages from a connector deployed on WebSphere Application Server, see Sending a message using the WSIF interface and Receiving a message using the WSIF interface.

Related tasks
Installing the SNA JCA LU62 Connector in Application Developer
Related reference
Interaction verbs for the SNA JCA LU62 Connector