![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
A WCF service does not require a WSDL to function, but integration within ActiveMatrix requires that you define the service contract in WSDL format. WCF services support the generation of the contract definition in WSDL form using the Microsoft svcutil utility:
• svcutil /t:metadata service implementation assemblysvcutil /t:metadata C:\samples\HelloWorld\HelloWorldSvc\bin\HelloWorldSvc.dll
• tempuri.org.wsdl An abstract WSDL file containing the port type, operation, and message definitions
• tempuri.org.xsd Types imported by the WSDL file
• schemas.microsoft.com.2003.10.Serialization.xsd Standard Microsoft typesSince there is no clear association between these file names and the service they originated from, if you have more than one WCF Host component in the composite, there could be name conflicts when you import the files into TIBCO Business Studio.svcutil /t:metadata http://localhost:8082/ihelloworld?wsdl
• tempuri.org.wsdl An abstract WSDL file containing the port type, operation, and message definitions
• tempuri.org.xsd Types imported by the WSDL file
• schemas.microsoft.com.2003.10.Serialization.xsd Standard Microsoft typesYou can also generate the concrete WDSL file from a running service using a browser. When you supply the service URL followed by ?wsdl, a concrete WSDL is displayed in the browser, which can be saved to a file.Importing WSDL and Schema Files, Implementation Assemblies and Configuration Files
1. Import the WSDL and schema files into the ActiveMatrix SOA project’s Service Descriptors folder.The WSDL file that the component implements must either be collocated with the implementation assembly or must be in the project's Service Descriptors folder. It cannot be in a subfolder of that folder. All WSDL files must be in the same location; they cannot be split between two locations.The WSDL files display error badges due to unresolved schema references. See Resolving XSD Schema References to know how to resolve the errors.The implementation assembly (xyz.dll) and its configuration file (xyz.dll.config) must be in the same folder location. The folder name cannot contain spaces.The config files display error badges due to unresolved service contract references. You resolve the errors in Mapping Service Contracts to Port Types.WSDL files generated with svcutil have import statements for importing XSD file namespaces that elements use in the WSDL. However, the schema files are not explicitly named using the schemaLocation attribute if WSDL is generated from a WCF assembly. For example:The schemaLocation attribute refers to a url if WSDL is generated from a running service. For example:<xsd:import schemaLocation="http://localhost:8089/?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /><xsd:import schemaLocation="http://localhost:8089/?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/AddressProxy" />TIBCO Business Studio requires that the imported namespaces identify the XSD file explicitly using the schemaLocation attribute. To resolve the schema references:
1. Right-click the WSDL file and select Open With > WSDL Editor. The port type graphic identifies unresolved messages with a broken reference icon. For example:
3. Click Browse.... An element browser displays.
a. In the Search Scope area, click the Workspace radio button.
b. In the Name(?=any character, *=any string): enter the element name and select the correct element according to the schema file displayed in the Declaration Location field.
c.
4. Right-click the WSDL file and select Open With > Text Editor.
5. There will be multiple schema elements. Delete the schema elements with the import statements without schemaLocation attributes or, with schemaLocation attributes referring to a url.WSDL files generated from a running service with wsHttpBindings may have an endpoint reference similar to that shown here included in the bindings. If so, TIBCO Business Studio flags an error (duplicate defined endpoint). The error is cleared by removing these configuration settings in a text editor:WCF service contracts are developed without referencing WSDL artifacts. However, ActiveMatrix requires information on the mapping between port types and WCF service contracts. To map the WCF service contracts defined in config files to port types:
1. Right-click the config file and select Open With > WCF Config File Editor. The editor opens to the Service tab.
b. Click OK. The contract is mapped to a WSDL file and port type and the error badge disappears.
4. Reference endpoint configuration
5. If the service implementation references endpoints, click the Client tab at the bottom of the editor. The Client tab contains a Reference Endpoint Configuration table listing the service implementation and the endpoints that it references. In order to add the references to the WCF Host component, you manually add items to the table.
a. For each endpoint that the service implementation references, click the Add button. A row is added to the Service Implementation column.In the Reference Endpoint column, choose an endpoint that component references from the drop-down list in the Endpoint column. Each endpoint that you choose is added as a component reference. An endpoint is added to the Clients area under the table. The endpoint displays an error badge because the service contract it exports is not mapped to a port type.
b. For each endpoint in the Clients area, click the unmapped service contract and map to a port type following the process in step 2.
6.
2. Create an ActiveMatrix SOA project as follows. Alternately, you can use the wizard to create a component as described in the following section, SOA Project from Implementation Using the Wizard.
c. Click the canvas and click the WCF Host component icon in the popup toolbar (see Popup Toolbars in the TIBCO ActiveMatrix Composite Editor User’s Guide) or click WCF Host in the Components group in the Palette and click the canvas. A WCF Host component is added to the Components area.
3. The SOA Project from Implementation project wizard creates a project, composite, services, and component whose port types are defined by an imported implementation. Before the wizard is used, the service contracts of the imported implementation should be mapped to the port types as specified in the following section, Mapping Service Contracts to Port Types. To create an SOA project from an existing implementation:
1. Select File > New > ActiveMatrix Resources... > ActiveMatrix SOA Project.
2. Click Next. The New ActiveMatrix SOA Project screen displays:
4. Select a project template SOA Project from Implementation from the Available Templates list and click Next.Specify component
5. In the Component Name field, accept the default name or type a new name and in the Component Implementation field, select WCF Host and click Next.
6. In the Implementation DLL/EXE field, click the Workspace... button to use an implementation that has already been imported into the workspace. The Implementation DLL field is filled in.
8. In the Available Port Types list, check the checkboxes next to the port types you want to expose and click Next.
9. For each port type, check the checkboxes next to the service types you want the composite to expose. For each service, click the Service Name column and rename the service as desired and click Next.
10. To accept the default folders and folder names for the project, click Finish. Otherwise, click Next and proceed with the remaining steps.Specify asset types
12. Click Next to step through the asset types and configure the names of special folders containing the assets.
13. Click Finish.When you complete the task, Business Studio creates a project containing the following resources:
1. In the Properties view, click the Implementation tab.
2.
4. Click OK. The Class and Location field are filled in. The services and references you configured in Mapping Service Contracts to Port Types are automatically added to the component.
5. To update the component after you change the implementation or config files of a WCF Host component:
1.
3. In the Properties view, click the Implementation tab.
4. If the reimported files have the same names as the old ones, click Load Implementation iconat the top right of the tabbed notebook heading. Any changes to the component’s service or references are reflected in the composite and property views.
5.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |