Vous êtes sur la page 1sur 3

Working with ActiveMatrix SOA Projects

This section describes how to create ActiveMatrix SOA projects, import files into a project, and import sample projects.

Creating ActiveMatrix SOA Projects


ActiveMatrix SOA projects are containers for the ActiveMatrix resources that you can develop with TIBCO Business Studio. To create anActiveMatrix SOA project: 1.Select File > New > ActiveMatrix Resources... > ActiveMatrix SOA Project. 2.Click Next. 3.Type a name in the Project name field. 4.Select the appropriate template. 5.Click Finish. The new project is created. It appears in the Project Explorer tree with these ActiveMatrix folders: Composites Deployment Packages Mediation Flows Service Descriptors Shared Resources A composite and service assembly are created in the project, based on the project name you typed in step 3. If the name you typed is ProjName, for example, a composite named ProjName.composite is created in the Composites folder and a service assembly named ProjName.saf is created in Deployment Packages folder.

Importing Projects and Files


This section describes how to import sample projects into a workspace, and how to import WSDL files into an ActiveMatrix SOA project. Importing Sample Projects When running Business Studio on Linux when using JDK 1.6 you may see multiple errors when importing samples. This occurs because of the maximum number of open files allowed. To change the limit of the maximum files that can be open: 1.Log in as a root user. 2.Edit /etc/security/limits.cof. 3.Add or edit the line:
* hard nofile 800000

The * refers to any user. Alternatively you may put a user name or @somegroup, where the user that will run Business Studio belongs to the group somegroup. Set the number indicating the limit to a large number. 4.Save the file, log out and log back in and then start Business Studio. To import sample projects: 1.Select File > Import.... to open the Import dialog box. 2.Expand the General node. 3.Select Existing Projects into Workspace. 4.Click Next to open the Import Projects dialog box. 5.Click the Browse.... button to the right of the Select root directory field. a.Navigate to AMX_HOME/2.3/samples/amsb or AMX_HOME/2.3/samples/amsg. b.Select one of the sample directories.

c. Click OK. 6.In the Projects area, check the checkboxes next to the projects to import. 7.Ensure that the Copy projects into workspace checkbox is selected. 8.Click Finish. The projects you imported are now listed in the Project Explorer tree. Importing WSDL Files At various points throughout the example, you need to import WSDL files into the ActiveMatrix SOA project. To import WSDL files from the file system: In the Project Explorer view, right-click the ProjName > Service Descriptors folder and select 1.Import > Service Import Wizard. Accept the default selection Import from a File and click Next to open the WSDL Selection dialog 2.box. 3.Click the Ellipsis button to the right of the Source Location field. a.Navigate to a directory containing the WSDL file. b.Click the file and then click Open. 4.Click Next. 5.Click Finish to import the WSDL file into your project.

Creating the Hello World ActiveMatrix SOA Project


This section describes how to create the Hello World SOA project, including SOAP service and Java component and implement the Hello World Java component. To create the Hello World ActiveMatrix SOA project: 1.Select File > New > ActiveMatrix Resources... > ActiveMatrix SOA Project. 2.Click Next. 3.Type HelloWorld in the Project name field. 4.In the Available Templates list, click SOA Project from WSDL. 5.Click Next. Select port type 6 . Select the Hello World port type: Click the Browse button next to Import WSDL and navigate to a AMX_HOME/2.3/samples/amsg/HelloWorld/com.tibco.amx.sample.helloworld.simple. . java.soa/Service Descriptors. b.Click HelloWorld.wsdl and click Open. c. Double-click HelloWorldPT. The port type is added to the Selected Port Types list. 7.Click Next. Specify SOAP service In the right pane, check the checkbox next to SOAP Service. Click the Service Name column and 8.type HelloWorldService. 9.Click Next. Specify Java component 10.In the Component Name field, type HelloWorldComp. 11.Click Next. Accept the default class name, package name, source location, and project name. 12.Click Finish. TIBCO Business Studio creates a project containing a composite with A Java component and SOAP service

An HTTP shared resource and HTTP shared resource profile A Java component implementation project containing an implementation skeleton. The composite should appear as in Figure 2. Figure 2 HelloWorld Composite

13.Click the Save button

Implementing the sayHello Method


To implement the sayHello method: 1.Double-click HelloWorldComp. The Java source file opens in the Java editor. 2.Replace the sayHello method implementation with the following:
public HelloResponseDocument sayHello(HelloRequestDocument firstName) { System.out.println("--> Generating Java Hello Component Response..."); String name = firstName.getHelloRequest()==null||firstName.getHelloRequest(). equals("")?"Friend":firstName.getHelloRequest(); HelloResponseDocument resp = HelloResponseDocument.Factory.newInstance(); resp.setHelloResponse("Hi " + name + "! " + "This is the Java component.\n"); System.out.println("--> Java Hello Component Response: \n\t\t" + resp.getHelloResponse()); return resp; }

3.Click the Save button

Vous aimerez peut-être aussi