Now you have the IBM Service Oriented Architecture Transfer Tool configured to talk to WebSphere Service Registry and Repository (WSRR) and API Connect, you can transfer a service into API Connect.

This is a follow on post from Installing the IBM Service Oriented Architecture Transfer Tool and performing a connection test.

Registering a service in WSRR

Firstly you need a service registered in WSRR. The WSRR should be running an unmodified Governance Enablement Profile or Service Management Profile.

There are two tutorials in the WSRR knowledge center which you can follow here:

Creating an organizational structure

Governing an existing service

Or you can load an import file into your WSRR server, the import is a download for the article “Using WebSphere Service Registry and Repository V8 and DataPower V5 for service level mediation policy enforcement” and is called “GeppedObjects.zip”.

Once the service is registered you will have an organization called “Common services” which has a business service called “Account eligibility” with a version “1.0”, a single Service Level Definition called “SLD – Eligibility service” and a single SOAP endpoint for “http://www.jkhle.com/jkhle/services/Eligibility”.

The service is in the production state. The SLD is “SLD Subscribable” which means it is approved. The endpoint is in the “Online” state and is for the Production environment.

Setting the organization to transfer

Next you set the WSRR organization to transfer to “Common services”. Edit your connectionproperties.properties file, and set the wsrrOrg to “Common services”:

Save the file.

Doing the transfer

Next you run the transfer in end-to-end mode. The tool will read the services for the Common services organization from WSRR (of which there is one), and generate an API and Product. The tool will then push the API and Product to the drafts area of API Connect.

Run the following from the command line:
C:\temp\tooltest>soatt --transferMode 1

The output will look like this:

SOA Transfer Tool - Transfer Services from WebSphere Service Registry and Repository (WSRR) to IBM API Connect v5 - Version 1.0.0
2017-04-11 16:39:32:003: Tests connections for APIC and WSRR have been passed
2017-04-11 16:39:32:004: Starting to download data from WSRR Server
2017-04-11 16:39:32:019: Fetching business services for organization 'Common services' using query 'BusinessServiceByOwningOrg'
2017-04-11 16:39:32:461: Fetched business services, count: 1
2017-04-11 16:39:32:463: Processing business service 1 of 1
2017-04-11 16:39:32:465: Fetching versions for business service with name 'Account eligibility' bsrURI '80348480-5e75-45d9.8b26.72bd9c7226e5' using query 'ServiceVersionsForBusinessService'
2017-04-11 16:39:32:707: Fetched versions, count: 1
2017-04-11 16:39:32:710: Processing version 1 of 1
2017-04-11 16:39:32:716: Fetching SLDs and endpoints for version with name 'Eligibility service' version '1.0' bsrURI '0805d308-7f9f-4f7d.a6a3.090b7709a3b0'
2017-04-11 16:39:32:721: Fetching SLDs for version with name 'Eligibility service' version '1.0' bsrURI '0805d308-7f9f-4f7d.a6a3.090b7709a3b0' using query 'SLDsForServiceVersion'
2017-04-11 16:39:32:927: Fetched SLDs for version
2017-04-11 16:39:32:930: Fetching endpoints for SLDs
2017-04-11 16:39:32:931: Fetching SOAP endpoints for SLD with name 'SLD - Eligibility service ' bsrURI '5aefcc5a-ae71-415d.a1b2.3e2de73eb2d3' using query 'SOAPEndpointsForSLD'
2017-04-11 16:39:32:938: Fetching REST endpoints for SLD with name 'SLD - Eligibility service ' bsrURI '5aefcc5a-ae71-415d.a1b2.3e2de73eb2d3' using query 'RESTEndpointsForSLD'
2017-04-11 16:39:33:180: Fetched endpoints for all SLDs
2017-04-11 16:39:33:184: Fetching consumers for SLDs
2017-04-11 16:39:33:187: Fetching consumer SLAs for SLD with name 'SLD - Eligibility service ' bsrURI '5aefcc5a-ae71-415d.a1b2.3e2de73eb2d3' using query 'ConsumingSLAsForSLD'
2017-04-11 16:39:33:359: Processing SLA 1 of 1 for SLD with name 'SLD - Eligibility service ' bsrURI '5aefcc5a-ae71-415d.a1b2.3e2de73eb2d3'
2017-04-11 16:39:33:366: Fetching consumer versions for SLA with name 'SLA - Account creation consumption of eligibility service' bsrURI '29e4a629-6b10-404c.891f.7e442e7e1ff3' and owning organization name 'Common services' using query 'ConsumingVersionsForSLA'
2017-04-11 16:39:33:584: Fetched SLDs and endpoints
2017-04-11 16:39:33:588: Fetching WSDLs and XSDs for version with name 'Eligibility service' version '1.0' bsrURI '0805d308-7f9f-4f7d.a6a3.090b7709a3b0' using initial query 'WSDLForServiceVersion'
2017-04-11 16:39:33:811: Fetched WSDLs and XSDs
2017-04-11 16:39:33:837: Generating YAML using WSRR data
2017-04-11 16:39:33:884: Storing YAML
2017-04-11 16:39:33:893: Creating WSDL YAML from WSDL
2017-04-11 16:39:43:972: Creating final SOAP API YAML
2017-04-11 16:39:44:002: Saving final SOAP API YAML
2017-04-11 16:39:44:347: Creating consumers YAML
2017-04-11 16:39:44:362: Validating consumers YAML
2017-04-11 16:39:44:362: Storing consumers YAML
2017-04-11 16:39:44:365: Validating Product
2017-04-11 16:39:54:019: Pushing Product with name 'eligibility-service' version '1.0' to API Connect drafts
2017-04-11 16:40:06:680: Processed all versions
2017-04-11 16:40:06:680: Processed all business services

The tool will find the “Account eligibility” business service and its version “Eligibility service” and generate a SOAP API, then push the SOAP API to API Connect.

Examining the results in API Connect

Log into the API Manager UI and switch to Drafts. Click on Products.
In the Products list you will see the product called “Eligibility service“ which was generated from the service.

In the API list you will see the API called “Eligibility service” which was generated from the service.

Click back to Products and click on “Eligibility service” to see details of the Product.

The name is taken from the WSRR service version and the description is taken from the WSRR business service. The version is taken from the WSRR service version.

Under the Contact section the name is taken from the WSRR service version creator. If the owner email was supplied in WSRR, then the Email in the Product would be populated from this value.

In the APIs section is the API “Eligibility service” which was created from the service version. The API is included in the Product.

There is a single plan called “SLD – Eligibility service” which includes the API. The plan sets a rate limit but does not enforce it, and no approval is required to sign up. The plan was created because there was an SLD in WSRR called “Eligibility service”.

Click on “All Products” to go back to Drafts and then click on APIs. Click on the API “Eligibility service” to see details of the API.

The name, description and version are taken from the WSRR service version.

The base path is “/jkhle/services/Eligibility” which is taken from the endpoint.

In the Paths section there is a single path “/validate”. This is the operation that is defined in the WSDL for the service.

In the Definitions section there are multiple definitions taken from the WSDL.

In the Paths section, expand the POST operation for “/validate”.

Note the input for the API is in the body and is the “validateInput” definition. The output for the API is the “validateOutput” definition. These correspond to the input and output messages for the SOAP service.

Click on the Assemble tab. On the canvas is a proxy policy. Click on the proxy policy on the canvas to see details.

The proxy policy invokes the URL taken from the WSRR endpoint which is “http://www.jkhle.com/jkhle/services/Eligibility” and passes through the HTTP method used and the contents of the request. In the case of this API the only method is POST and therefore the API gateway will take the POST request and invoke the back end, passing the message body through. As such the API is a “System API”.

Examining the results on the file system

When the tool runs, it leaves data on the file system. In the case of an error, you can examine the data to see what the tool did.

Open your user home directory and change into the directory .soatt/files.

c:\temp\tooltest>cd c:\users\IBM_ADMIN\.soatt\files
c:\Users\IBM_ADMIN\.soatt\files>dir
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files

16/02/2017  13:58    <DIR>          .
16/02/2017  13:58    <DIR>          ..
16/02/2017  13:58    <DIR>          80348480-5e75-45d9.8b26.72bd9c7226e5
               0 File(s)              0 bytes
               3 Dir(s)  55,412,482,048 bytes free
c:\Users\IBM_ADMIN\.soatt\files>

If you imported the sample service then the bsrURI of the business service will be 80348480-5e75-45d9.8b26.72bd9c7226e5 and the business service directory will be called 80348480-5e75-45d9.8b26.72bd9c7226e5. If you created the sample service then the bsrURI of the business service will be different. Change into the business service directory.

c:\Users\IBM_ADMIN\.soatt\files>cd 80348480-5e75-45d9.8b26.72bd9c7226e5
c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5>dir
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c
7226e5

16/02/2017  13:58    <DIR>          .
16/02/2017  13:58    <DIR>          ..
11/04/2017  16:40    <DIR>          0805d308-7f9f-4f7d.a6a3.090b7709a3b0
16/02/2017  13:59    <DIR>          docs
               0 File(s)              0 bytes
               4 Dir(s)  55,412,461,568 bytes free

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5>

In the business service directory, the docs directory contains the charter for the business service.

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5>dir doc
s
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c
7226e5\docs

16/02/2017  13:59    <DIR>          .
16/02/2017  13:59    <DIR>          ..
11/04/2017  16:39            30,208 AccountEligibilityCharter.doc
               1 File(s)         30,208 bytes
               2 Dir(s)  55,412,416,512 bytes free

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5>

In the business service directory is a directory for the service version. If you imported the sample service the directory is called 0805d308-7f9f-4f7d.a6a3.090b7709a3b0. Change into this directory.

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5>cd 0805
d308-7f9f-4f7d.a6a3.090b7709a3b0

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5\0805d30
8-7f9f-4f7d.a6a3.090b7709a3b0>dir
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c
7226e5\0805d308-7f9f-4f7d.a6a3.090b7709a3b0

11/04/2017  16:40    <DIR>         .
11/04/2017  16:40    <DIR>          ..
11/04/2017  16:39             1,063 0805d308-7f9f-4f7d.a6a3.090b7709a3b0_wsdls.zip
11/04/2017  16:39             5,347 api.yaml
11/04/2017  16:39                38 consumers.yaml
16/02/2017  13:59    <DIR>          docs
11/04/2017  16:39    <DIR>          logs
11/04/2017  16:39               603 product.yaml
11/04/2017  16:40               257 result.json
               5 File(s)          7,308 bytes
               4 Dir(s)  55,412,387,840 bytes free

The file product.yaml contains the YAML definition for the Product. The file api.yaml contains the YAML Swagger definition for the API, which you viewed in the Source tab in the API Manager. The file 0805d308-7f9f-4f7d.a6a3.090b7709a3b0_wsdls.zip contains the WSDL for the service. The docs directory contains documents attached on the artifacts relationship.

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5\0805d30
8-7f9f-4f7d.a6a3.090b7709a3b0>dir docs
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c
7226e5\0805d308-7f9f-4f7d.a6a3.090b7709a3b0\docs

16/02/2017  13:59    <DIR>          .
16/02/2017  13:59    <DIR>          ..
11/04/2017  16:39             3,055 EligibilityService.wsdl
               1 File(s)          3,055 bytes
               2 Dir(s)  55,412,207,616 bytes free

In the logs directory are various diagnostic files which can be used for troubleshooting.

c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c7226e5\0805d30
8-7f9f-4f7d.a6a3.090b7709a3b0>dir logs
 Volume in drive C is Local Disk
 Volume Serial Number is 246F-B420

 Directory of c:\Users\IBM_ADMIN\.soatt\files\80348480-5e75-45d9.8b26.72bd9c
7226e5\0805d308-7f9f-4f7d.a6a3.090b7709a3b0\logs

11/04/2017  16:39    <DIR>         .
11/04/2017  16:39    <DIR>          ..
11/04/2017  16:39               542 apiFromTemplate.yaml
11/04/2017  16:39                45 consumersFromTemplate.yaml
11/04/2017  16:39               821 productFromTemplate.yaml
11/04/2017  16:39             5,523 wsdl.yaml
11/04/2017  16:39               488 wsrr.yaml
11/04/2017  16:39            19,838 wsrrdata.json
               6 File(s)         27,257 bytes
               2 Dir(s)  55,406,927,872 bytes free

Conclusion
You transferred a single service from WSRR to API Connect, and saw how the transfer tool maps the WSRR artifacts to API Connect.

For more details see the NPM page for the tool.

Join The Discussion

Your email address will not be published. Required fields are marked *