Building Web Services Using BEA WebLogic 7.0

This topic walks you through the installation, generation, and deployment of a Web service using BEA WebLogic 7.0. BEA WebLogic 7.0 Web services are implemented through the JCA adapter for WebLogic.

Installing BEA WebLogic 7.0

To install and set up BEA WebLogic 7.0
  1. Following the appropriate instructions, install both BEA WebLogic 7.0 and Synapta Services Builder for Screens, (only Task Builder is needed) on the same computer.

  2. During or after installation, you have the option of creating a new eai domain. When you do so, note the port, username, and password that you use when creating the eai domain. Attachmate currently does not support Mail. You can enter whatever values you find appropriate during this step.

  3. Edit the SetEaiDomainData.cmd file that was generated for the new domain by entering the following information after the samples server classpath entries:

    • set EAIROOT=C:\progra~1\Attachmate\EAI
    • set SVRCP=%WLI_HOME%\lib\wlaiclient.jar;
      %SVRCP%;%EAIROOT%\Common\config

  4. Run the Integration Database Wizard. Choose Create Database, and use the other default options.

  5. Start the WebLogic server.

  6. Add the JCA adapter to WebLogic.

    • Run http://<MachineName>:<WebLogicPort>\console

    • Select Applications from the left pane.

    • Select Install a New Application from the right pane.

    • Browse to the <AttachmateInstall>\EAI\ScreenConnectors directory.

    • Open ATTACHMATE_SCREEN_ICA_1_0.ear.

    • Select the configured server, and add to list of servers.

    • Select Deploy Application. After auto refresh occurs, verify that the deployment was successful.

Note It is best to have at least one Web service ready to deploy, or already deployed to the WebLogic server when you set up an application view. This enables you to run your initial configuration of the application view from end to end. You can add additional Web services to an existing application view.

Generating Web Services using BEA WebLogic 7.0

To generate Web services using BEA WebLogic 7.0
  1. In Task Builder, select your generation options. From the Tools menu, select Options, and then from the Generating page, select BEA WebLogic Integration 7.0, and click Properties.
    Set this property
    To this
    UniqueNameXSLT <InstallDirectory>\Attachmate\EAI\ScreenConnectors\ws\templates\internal\unique-naming.xslt
    Service.Host <MachineName>
    Service.Username system (default)
    WL.Home <InstallDirectory>\bea7\weblogic700
    Deploy.Dir The location on the server to which you want to install the Web service.
    Service.Password Whatever you set the password to at installation. The default value is security.
    Service.Port Whatever you set the port to at installation. The default value is 7001.

  2. Click OK. These are global generation options for BEA WebLogic 7.0 and will be used in all your Task Builder projects. If needed, you can modify these options during generation.

  3. Generate your BEA WebLogic Integration 7.0 Web service.

Deploying and Accessing Web Services using BEA WebLogic 7.0

To deploy to the design-time computer where the Web service was generated
  1. Run deploy.cmd from <install_directory>\EAI\Recordings\<project_name>\webservice\Weblogic7Target. The deploy.cmd file copies the Web service to the directory you specified in the Deploy.Dir property within Task Builder under Generate Options for WebLogic 7.0.

  2. If this is the first Web service deployed on the server, create or copy both the AppProperties.properties file and the <task_name>mappings.xml file that are in the install_directory\Attachmate\EAI\Recordings\project_name\webservice\Weblogic61Target directory to install_directory\Attachmate\EAI\Common\config, or to any folder that in in the WebLogic classpath.

    See The AppProperties and XML Mappings Files for detailed information on these files.

  3. Rename the <task_name>mappings.xml file to a generic name such as GlobalTskMappings.xml.

  4. Modify the Mapper.Configuration.Filename property in the #Global properties section of the AppProperties.properties file to point to the GlobalTaskmappings.xml file. This path may vary depending on the location of your AppProperties.properties file. Since the username and password are generated by default, verify that each is correct in the file.

  5. When you install subsequent Web services on a server, the following information must be copied to the files you created in Step 3:

    • The #Web Service section of the <install_directory>\EAI\Recordings\<project_name>\webservices\Weblogic61Target\AppProperties.properties file to the #Web Service section of the <install_directory>\EAI\Common\config\AppProperties.properties file

      -and-

    • The Mappings section of the <install_directory>\EAI\Recordings\<project_name>\webservices\Weblogic61Target\TaskMappings.xml file to the Mappings section of the <install_directory>\EAI\Common\config\GlobalTaskMappings.xml file
Note For each mapping in the GlobalTaskMappings.xml file:
  • There is a section for the application view name. Enter the name of the application view where you intend to deploy the Web service.
  • Verify that the host and port sections are correct.
  • The service name section entry should match the name of the service used in the application view.
To deploy to a different computer than the one where the Web service was generated
  • To manually deploy the Web service or if you are deploying to another server: Copy the generated EAR file to the domain's auto-deployment directory, or manually deploy the EAR via the WebLogic console.

    The generated EAR file will have a name based on your project or task and can be found on your Task Builder computer in the following location:
    install_directory\Attachmate\EAI\Recordings\project_name\webservice\WebLogic61Target

    1. Copy the generated EAR file to the remote WebLogic server <directory>. The generated EAR will have a name based on your project or task and can be found on your Task Builder computer in the following location:
      install_directory\Attachmate\EAI\Recordings\project_name\webservice\WebLogic61Target

    2. Copy the task file to a location on the remote machine.

    3. You must also copy the appropriate sections of the AppProperties.properties file and the <project_name>Mappings.xml file. See Step 5 above.

To access the Web service
  • To access the client JAR that is generated by WebLogic, point your browser to:
    http://<machine_name>:<port>/project_name/client.jar
    You will be prompted to save the JAR file. It may be helpful to rename the JAR to something more descriptive.

  • After you have saved the JAR file, the classes contained in the JAR can be used to access the Web service.
    For example, the code for a service\map named "T1" with a task called "task":
    	T1.T1Service impl = new T1.T1Service_Impl("http://machineName:port/T1/T1Serviceuri?WSDL");
    	T1.T1ServicePort service = impl.get T1ServicePort( );
    	T1.taskInput.ScreenInputs inputs = new T1.taskInput.ScreenInputs( );
    	T1.taskOutput.ScreenOutputs outputs = service.task( inputs );
    At this point the outputs object can be accessed for information returned by the task.
Warning When accessing a task, either through a Web service or any task interface object (Java bean, XML, or service bean), if the Runtime Service is not installed on the same computer where the Web service is deployed, or the task name does not match the name of the NavMap, then you must edit the TaskConfigurations.xml file. See Modifying the Task Configuration File for more information.
Related Topics
Bullet Using Tasks in Your Applications, Overview
Bullet Using Web Services
Bullet The AppProperties and XML Mappings Files
Bullet Configuring the JCA Adapter for WebLogic Integration, Overview
  Attachmate