API adapter creation device, API adapter creation method, and API adapter creation program

An Application Program Interface (API) adapter creation apparatus is configured to accept, from a developing engineer, a setting of an execution order of a wholesale service API invoked by internal processing of an adapter API provided by an API adapter, a setting of a request parameter of the adapter API serving as an acquisition source of a request parameter of the wholesale service API, and a setting of a response parameter of the adapter API serving as a reflection destination of a response parameter of the wholesale service API. The API adapter creation apparatus generates a source code based on the accepted settings.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a National Stage application under 35 U.S.C. § 371 of International Application No. PCT/JP2019/027797, having an International Filing Date of Jul. 12, 2019, which claims priority to Japanese Application Serial No. 2018-146236, filed on Aug. 2, 2018. The disclosure of the prior application is considered part of the disclosure of this application, and is incorporated in its entirety into this application.

TECHNICAL FIELD

The present invention relates to an API adapter creation apparatus, an API adapter creation method, and an API adapter creation program that enable an API adapter provided in a multi-service coordination execution apparatus to be efficiently created.

BACKGROUND ART

In recent years, a communication service using a Business to Business to X (B2B2X) model for a service provider to create a new digital service, in which the digital service is provided to end users using digital services (wholesale services) of other providers, rather than building the entire service using its own facilities has become popular.

With the spread of services using the B2B2X model, the importance of a multi-service coordination execution apparatus for building and operating a coordinated service that is created by combining a plurality of wholesale services has increased. Due to the frequent introduction of new wholesale services and changes in existing service specifications, service providers of coordinated services are required to catch up with new wholesale services and changes in existing service specifications at low costs in a short period of time.

Service providers provide services as a REpresentational State Transfer Application Program Interface (REST API) (hereinafter also simply referred to as an API) on the HyperText Transfer Protocol (HTTP). In addition, service providers also define and publish API specifications such as the names of APIs, the Uniform Resource Locators (URL) of access destinations, HTTP methods, and parameters.

Service providers that provide coordinated services refer to the API specifications of the wholesale services to design a method of combining the wholesale services and develop equipment (multi-service coordination execution apparatus) to build and provide such coordinated services. There are techniques described in Non Patent Literature 1 and Non Patent Literature 2 as architectures for a multi-service coordination execution apparatus that can easily cope with the new wholesale services and change in existing service specifications. In addition, Non Patent Literature 1 and Non Patent Literature 2 propose API adapters that can easily support new wholesale services or changes in specifications by absorbing difference in different wholesale service specifications.

CITATION LIST

Non Patent Literature

Non Patent Literature 1: “A Study on Easy Development of Web API Adapter,” Naoki Take and 5 others, Steering Committee on Network Software, the Institute of Electronics, Information, and Communication Engineers, Oct. 19, 2017

Non Patent Literature 2: “Applicability of Swagger Codegen in Development of API,” General Conference Lecture of the Institute of Electronics, Information, and Communication Engineers, B-14-13, the Institute of Electronics, Information, and Communication Engineers, Mar. 20 to 23, 2018

SUMMARY OF THE INVENTION

Technical Problem

Non Patent Literature 1 and Non Patent Literature 2 describe that API adapters can be easily developed by using commercially available libraries for some constituent components (modules) of the API adapter, making the components into shared libraries, and automatically generating source codes based on the specifications of wholesale service APIs. However, because the API adapters still have modules that are required to be manually designed and implemented, easier development thereof has been demanded.

The present invention has been made in view of such a background, and an objective of the present invention is to provide an API adapter creation apparatus, an API adapter creation method, and an API adapter creation program that enable an API adapter for wholesale services provided in a multi-service coordination execution apparatus to be efficiently created.

Means for Solving the Problem

In order to solve the above-described problems, the invention described in claim1is an Application Program Interface (API) adapter creation apparatus configured to create an adapter API provided by an API adapter of a plurality of wholesale services, the adapter provided in a multi-service coordination execution apparatus configured to construct a coordinated service in which the wholesale services are combined, the API adapter creation apparatus including an API execution order setting unit configured to accept a setting of an execution order of a wholesale service API indicating the API of the wholesale service invoked by internal processing of the adapter API; an API request parameter acquisition source setting unit configured to accept a setting of a request parameter of the adapter API serving as an acquisition source of a request parameter of the wholesale service API; an API response parameter reflection destination setting unit configured to accept a setting of a response parameter of the adapter API serving as a reflection destination of a response parameter of the wholesale service API; and a source code generation unit configured to generate a source code of the adapter API based on the setting of the execution order, the setting of the acquisition source, and the setting of the reflection destination.

In addition, the invention according to claim5is an API adapter creation method of an API adapter creation apparatus configured to create an adapter API provided by an API adapter of a plurality of wholesale services, the API adapter provided in a multi-service coordination execution apparatus configured to construct a coordinated service in which the wholesale services are combined, the API adapter creation method including accepting a setting of an execution order of a wholesale service API indicating the API of the wholesale service invoked by internal processing of the adapter API; accepting a setting of a request parameter of the adapter API serving as an acquisition source of a request parameter of the wholesale service API; accepting a setting of a response parameter of the adapter API serving as a reflection destination of a response parameter of the wholesale service API; and generating a source code of the adapter API based on the setting of the execution order, the setting of the acquisition source, and the setting of the reflection destination.

With this configuration, the API adapter creation apparatus can generate a source code including invocation of a wholesale service API in accordance with an execution order defined by a developing engineer of the API adapter, acquisition of a request parameter of the wholesale service API from request parameters of an adapter API, and reflection of a response parameter of the wholesale service in a response parameter of the adapter API. Thus, a developing engineer does not need to describe the source code and thus can focus on study of the logic. As a result, the development period for the API adapter is reduced, enabling new wholesale services or changes in specifications to be dealt with in a short period of time.

The invention according to claim2is the API adapter creation apparatus according to claim1, further including an API execution condition setting unit configured to accept a setting of an execution condition for execution of the wholesale service API, in which the source code generation unit generates a source code of the adapter API including content of the setting of the execution condition.

With this configuration, the API adapter apparatus can generate a source code that includes conditional invocation of the wholesale service API.

The invention according to claim3is the API adapter creation apparatus according to claim1, further including an API iteration condition setting unit configured to accept a setting of an iteration condition for iterative execution of the wholesale service API, in which the source code generation unit generates a source code of the adapter API including content of the setting of the iteration condition.

With this configuration, the API adapter apparatus can generate a source code that includes iterative invocation of the wholesale service API.

The invention according to claim4is the API adapter creation apparatus according to any one of claims1to3, further including an API request/response parameter design support unit configured to set, when specification of a request parameter of the wholesale service API is accepted, a request parameter of the adapter API having an identical name to that of the request parameter as an acquisition source, and to set, when specification of a response parameter of the wholesale service API is accepted, a response parameter of the adapter API having an identical name to that of the response parameter as a reflection destination, in which the source code generation unit generates a source code of the adapter API that includes content of the setting of the acquisition source and the reflection destination set by the API request/response parameter design support unit.

With this configuration, a developing engineer can set a request parameter and a response parameter with fewer operations than when the API adapter apparatus of claim1is used, making the development of the API adapter more efficient.

The invention according to claim6is an API adapter creation program for causing a computer to function as the API adapter creation apparatus according to any one of claims1to4.

With this configuration, the API adapter apparatus according to any one of claims1to4can be realized by using a general computer.

EFFECTS OF THE INVENTION

According to the present invention, it is possible to provide an API adapter creation apparatus, an API adapter creation method, and an API adapter creation program that enable an API adapter for a wholesale service provided in a multi-service coordination execution apparatus to be efficiently created.

DESCRIPTION OF EMBODIMENTS

Hereinafter, an overall configuration of a multi-service coordination execution apparatus with an API adapter, a configuration of the API adapter, and a problem in developing the API adapter will be described, and then an API adapter creation apparatus (seeFIG. 4, which will be described below) in a mode (embodiment) for implementing the present invention will be described.

Configuration of Multi-Service Coordination Execution Apparatus

FIG. 1is a diagram illustrating a configuration of a network system including a multi-service coordination execution apparatus900according to the present embodiment. The multi-service coordination execution apparatus900includes a coordination execution apparatus main unit910and API adapter units920A to920C.

A service provider980issues a coordination order950to the multi-service coordination execution apparatus900and receives a coordinated service965via a multi-service collaboration API970. The coordination order950is a message to request the coordinated service965in which a network A service951A, a cloud B service951B, and an application C service (which is described as an app C service inFIG. 1)951C are coordinated.

The coordination execution apparatus main unit910receives the services included in the received coordination order950from the wholesale service provider, coordinates the services, and provides the services to the service provider980as the coordinated service965. With reference to a catalog (a setting file), which is not illustrated, the coordination execution apparatus main unit910generates a single order955A corresponding to the network A service951A, a single order955B corresponding to the cloud B service951B, and a single order955C corresponding to the application C service951C, the services included in the coordination order950.

The coordination execution apparatus main unit910requests a wholesale service via the coordination execution apparatus main unit API973using the single orders955A to955C as parameters. The coordination execution apparatus main unit910receives services962A to962C and coordinates the services to generate the coordinated service965and provide the coordinated service to the service provider980.

The API adapter unit920A accepts the single order955A, transmits a service A request956A to a wholesale service provider A985A via a wholesale service API975A, receives a service A961A, and provides a service962A to the coordination execution apparatus main unit910.

The API adapter unit920B accepts the single order955B, transmits a service B request956B to a wholesale service provider B985B via a wholesale service API975B, receives a service B961B, and provides a service962B to the coordination execution apparatus main unit910.

The API adapter unit920C accepts the single order955C, transmits a service C request956C to a wholesale service provider C985C via a wholesale service API975C, receives a service C961C, and provides a service962C to the coordination execution apparatus main unit910.

The wholesale service APIs975A to975C are APIs that are provided independently by the wholesale service provider A985A, the wholesale service provider B985B, and the wholesale service provider C985C. The API adapter units920A to920C absorb differences of the wholesale service APIs975A to975C and provide a common coordination execution apparatus main unit API973to the coordination execution apparatus main unit910.

Thus, if a new wholesale service emerges and a wholesale service API of the service is provided, a corresponding API adapter unit is developed, and if the wholesale service is registered in a catalog, the multi-service coordination execution apparatus900can provide a coordinated service including the new wholesale service, without changing the coordination execution apparatus main unit910. Thus, the time and cost required for the new wholesale service depend on the time and cost required for development of the API adapter units920A to920C, and thus easy development is demanded.

Configuration of API Adapter Unit

FIG. 2is a diagram illustrating a configuration of an API adapter unit920according to the present embodiment. The API adapter unit920includes an order accepting unit921, an API invocation logic unit922, and a wholesale service API execution unit923.

The order accepting unit921accepts a single order955from the coordination execution apparatus main unit910and acquires the content of the order. In addition, the order accepting unit921processes a response with respect to the coordination execution apparatus main unit910.

The API invocation logic unit922invokes (executes) an individual services provided by the wholesale service provider985via the API to obtain the service requested in the single order955. At this time, the API invocation logic unit922generates a request parameter for the individual service in an execution order of individual services provided by the wholesale service provider985and invokes the service via the API to process a response parameter. The wholesale service API execution unit923assembles HTTP requests in response to the invocation of the API invocation logic unit922and transmits the requests to the wholesale service provider985, receives a response, and outputs it to the API invocation logic unit922.

The order accepting unit921enables efficient development by creating a shared library. Moreover, the wholesale service API execution unit923can perform efficient development by using an automated generation tool for source codes based on API specifications for the individual services (see Non Patent Literature 2). However, manual design and implementation of the API invocation logic unit922are required, which incur more time and cost required for the development.

In the present invention, the source codes of the API invocation logic unit922are generated by manually setting only minimum items in the design of the API invocation logic unit922, which enables the API adapter unit920to be efficiently developed.

Note that, in the following description, regarding a wholesale service and a wholesale service API as the same, requesting (invoking) a wholesale service via a wholesale service API will also be described as invoking (executing) a wholesale service API, or the like.

Development Procedure of API Invocation Logic Unit

FIG. 3is a flowchart for explaining a development procedure of the API invocation logic unit922according to the present embodiment. Referring toFIGS. 3 and 2, a development procedure of the API invocation logic unit922performed by a developing engineer using an API adapter creation apparatus (seeFIG. 4, which will be described later) will be described.

In step S101, the developing engineer understands an API of a wholesale service. Specifically, the developing engineer refers to the specifications of the API provided by the wholesale service provider985or uses an API test tool commercially available in the industry to understand the wholesale service API while checking the specifications (operation verification of the API).

In step S102, the developing engineer defines logic of the API (which is an API provided as the coordination execution apparatus main unit API973, an API supported by the API adapter unit920, and an API to be developed, which is also referred to as an adapter API). Specifically, the developing engineer determines an adapter API and defines (sets) an execution order (seeFIG. 8, which will be described below), execution conditions (seeFIGS. 14 and 15which will be described below), and iteration conditions (seeFIGS. 17 and 18, which will be described below) of individual services of wholesale services (wholesale service API) required to cause the adapter API to function. Note that, regarding the adapter API and an internal process thereof as the same in the following description, the adapter API will also be described as invoking (executing) a wholesale service (wholesale service API).

In step S103, the developing engineer defines parameters. Specifically, the developing engineer defines a request parameter (seeFIG. 9, which will be described below) included in the single order955which is an acquisition source of the request parameter of the individual services, and a response parameter (seeFIG. 10, which will be described below) of the service962which is a reflection destination of the response parameter of the individual services.

In step S104, the developing engineer instructs the API adapter creation apparatus to generate source codes of the API invocation logic unit922(seeFIG. 21which will be described below).

In step S105, the developing engineer instructs the API adapter creation apparatus to generate execution files of the API adapter unit920including the order accepting unit921and the wholesale service API execution unit923.

It has been described that the developing engineer performs steps S101to S105sequentially. However, the developing engineer develops the adapter API (the API adapter unit920) while ascertaining insufficient understanding of the wholesale service API in the middle of step S103and returning to steps S101and S102or finding an operation defect in execution of the execution files and returning to steps S102and S103.

Overall Configuration of API Adapter Apparatus

FIG. 4is a diagram illustrating an overall configuration of the API adapter creation apparatus100according to the present embodiment. Referring toFIG. 4, a configuration of the API adapter creation apparatus100that a developing engineer uses to develop the API adapter described in steps S102to S105ofFIG. 3will be described.

The API adapter creation apparatus100includes a controller110, a storage unit120, and an input/output unit130. The input/output unit130is configured with an input device (not illustrated) such as a keyboard or a mouse and an output device (not illustrated) such as a display, and accepts and displays logic and parameters of the adapter API defined by the developing engineer.

The controller110is configured with a central processing unit (CPU) and includes a wholesale service API specification reference unit111, an API execution order setting unit112, an API execution condition setting unit113, an API iterative execution setting unit114, an API request parameter acquisition source setting unit115, an API response parameter reflection destination setting unit116, an API request/response parameter design support unit117, a source code generation unit118, and an adapter generation unit119.

The wholesale service API specification reference unit111reads the API specifications described in the standard format of the wholesale service and stores them in a wholesale service API specification database210of the storage unit120(described as a wholesale service API specification database (DB) inFIG. 4, and seeFIG. 5which will be described below). Also, the wholesale service API specification reference unit111displays the name and a parameter of the read API included in the API specifications of the wholesale service on a display.

Wholesale Service API Specification Database

FIG. 5is a diagram illustrating a data configuration of the wholesale service API specification database210according to the present embodiment. The wholesale service API specification database210is configured with API specifications229for individual services provided by the wholesale service provider985(seeFIG. 2). Each of the API specifications229includes descriptions of an API name211, a method212, an endpoint213, a request parameter214, a response parameter219, and an expected response224.

The API name211is the name of an API. The method212is an HTTP method used when invoking an API, and includes GET, POST, or the like. The endpoint213is the address used to invoke an API.

The request parameter214is, for example, tabular data, in which one row (record) represents one request parameter and includes columns (attributes) of an object215, a parameter216, and a type217. The object215is the name of an object including a parameter indicated by a record. The parameter216is the name of a parameter. The type217is the type of a parameter. A record218represents a parameter “email” that is included in an object “AuthRequest” having a type of “string.”

The response parameter219is, for example, tabular data, in which one record represents one response parameter and includes attributes of an object220, a parameter221, and a type222. The object220, the parameter221, and the type222have definitions similar to those of the object215, the parameter216, and the type217, respectively. A record223represents a parameter “apiToken” that is included in an object “AuthResponse” having a type of “string.”

The expected response224indicates an HTTP status code at the time of a normal response after invoking the API.

Controller of API Adapter Creation Apparatus (Logic Setting)

Returning toFIG. 4, the API execution order setting unit112sets an order of wholesale service APIs to be invoked by the adapter API. Specifically, the API execution order setting unit112reflects an order of invoking (order of executing) the wholesale service APIs (seeFIG. 8which will be described below) defined by the developing engineer in an API execution order database230(seeFIG. 6), which will be described below.

The API execution condition setting unit113sets an execution condition for the wholesale service APIs to be invoked by the adapter API. Specifically, the API execution condition setting unit113reflects a wholesale service API (seeFIG. 14, which will be described below) to be invoked under a condition defined by the developing engineer or its execution condition (an invocation condition, seeFIG. 15, which will be described below) in the API execution order database230.

The API iterative execution setting unit114sets a wholesale service API to be repeatedly invoked by the adapter API. Specifically, the API iterative execution setting unit114reflects a wholesale service API (seeFIG. 17which will be described below) to be repeatedly invoked or an iteration condition (seeFIG. 18, which will be described below) defined by the developing engineer in the API execution order database230, which will be described below.

API Execution Order Database

FIG. 6is a diagram illustrating a data configuration of the API execution order database230according to the present embodiment. The API execution order database230is, for example, tabular data, in which one row (record) represents processing performed by one adapter API. Each record includes columns (attributes) for an API231, a type232, an execution order233, a processing type234, processing235, and additional information236.

The API231is the name of the adapter API. The type232is a type of the adapter API, in which “A” indicates new, “M” indicates modification, and “D” indicates deletion. One adapter API is identified by a combination of the API231with the type232.

The execution order233indicates an order of execution in one adapter API. The processing type234indicates a type of processing indicated by the record, including “API execution” indicating invocation of a wholesale service API and “control” indicating conditional execution or iterative execution.

The processing235indicates content of processing. If the processing type234is “API execution,” the processing235represents the API name of the wholesale service to be invoked (see the API name211inFIG. 5). If the processing type234is “control,” the processing235represents “if” indicating the start of conditional execution and an execution condition, “end if” indicating the end of the conditional execution, “for” indicating the start of iterative execution and an iteration condition, or “end for” indicating the end of the iterative execution.

The additional information236is an execution condition or an iteration condition. Records241and242indicate that an adapter API named “XXX” in the type232of “A” (new) invokes (executes) a wholesale service API “postAuth”first and then invokes “postNetwork.”

Records243to248indicate that an adapter API named “YYY” in the type232of “A” invokes “postAuth” first (see record243), and subsequently performs iterative processing (see a record244). A condition for the iterative processing is “productOrder.characteristic.network” indicated in the additional information236of the record244. In particular, “productOrder.characteristic.network” is a variable indicating the sequence, and repeats processing for each element of the sequence. The content of the iterative processing is processing performed up to “end for” (see a record248) corresponding to “for” that is processing235of the record244and the processing indicated by records245to247is repeated.

The processing of the records245to247will be described below. The record245indicates conditional execution, and the condition is “productOrder.characteristic.network.enable=true” indicated in the addition information236. If a value of the parameter indicated by “productOrder.characteristic.network.enable” is “true,” the processing is performed. The content of the processing to be performed is processing performed up to “end if” (see the record247) corresponding to “if” which is the processing235of the record245, and is processing to invoke the wholesale service API “postNetwork” indicated by the record246.

Controller of API Adapter Creation Apparatus (Parameter Setting)

The API request/response parameter design support unit117sets an acquisition source of the request parameter and a reflection destination of the response parameter of the wholesale service API, without being defined by the developing engineer. Specifically, based on the object215, the parameter216, and the type217of the request parameter214(seeFIG. 5) of the wholesale service API, the API request/response parameter design support unit117defines a request parameter for the adapter API serving as an acquisition source to reflect it in the API parameter database250(seeFIG. 7) which will be described below. In addition, the API request/response parameter design support unit117defines a response parameter of the adapter API serving as a reflection destination to reflect it in the API parameter database250(seeFIG. 7) which will be described below, based on the object220, the parameter221, and the type222of the response parameter219(seeFIG. 5) of the wholesale service API.

API Parameter Database

FIG. 7is a diagram illustrating a data configuration of the API parameter database250according to the present embodiment. The API parameter database is, for example, tabular data in which one row (record) indicates parameters of the wholesale service API and includes columns (attributes) of API251, type252, processing253, parameter type254, object255, parameter256, and input source/reflection destination257.

The API251and the type252are similar to the API231and the type232of the API execution order database230(seeFIG. 6), respectively, and the parameters of the wholesale service API indicated by the records indicate which adapter API that is invoking. The processing253corresponds to the processing235and the execution order233of the API execution order database230, and the parameters indicated by the record indicate parameters for invocation of a wholesale service API. Because there is a case in which an adapter API invokes the same wholesale service API multiple times, a wholesale service API that is invoked in combination of the processing235with the execution order233is specified.

The parameter type254is a type of a parameter, which is “request” or “response.” The object255corresponds to the object215of the request parameter214or the object220of the response parameter219illustrated inFIG. 5. In addition, the parameter256corresponds to the parameter216of the request parameter214or the parameter221of the response parameter219. The object255and the parameter256can allow which parameter of the wholesale service API shown in the processing253to be specified.

The input source/reflection destination257is a parameter for an adapter API serving as an input source or a reflection destination.

Record261indicates that, in invocation of the wholesale service API of “postAuth” having an execution order of “1” of the adapter API named “YYY” of “A” (see the record243ofFIG. 6), an input source of the parameter256“email” having the object255of the request parameter “AuthRequest” is “accountInfo.email”of the adapter API.

Record262indicates that, in invocation of the wholesale service API of “postNetwork” having an execution order of “4” (see the record246), an input source of the parameter256“name” having the object255of the request parameter is “productOrder.characteristic.network.name”of the adapter API.

Record263indicates that, in invocation of the wholesale service API of “postAuth” having an execution order of “1” (see the record243ofFIG. 6), a reflection destination with the parameter256“apiToken” having the object255of the response parameter “AuthResponse” is “intemalData.apiToken”of the adapter API.

Controller of API Adapter Creation Apparatus (Other)

Returning toFIG. 4, the source code generation unit118generates a source code (seeFIG. 21, which will be described below) of the API invocation logic unit922based on information stored in the API execution order database230and the API parameter database250. This source code generation process will be described with reference toFIGS. 19 and 20, which will be described below. The adapter generation unit119compiles source codes to produce the API adapter unit920including the order accepting unit921and the wholesale service API execution unit923.

Storage Unit of API Adapter Creation Apparatus

Next, the storage unit120of the API adapter creation apparatus100will be described. The storage unit120includes a wholesale service API specification database210, the API execution order database230, the API parameter database250, an API adapter source code repository270, and an API adapter execution file repository280.

The wholesale service API specification database210, the API execution order database230, and the API parameter database250have already been described. The API adapter source code repository270is a repository of source codes of the API adapter and the adapter generation unit119stores generated source codes in the API adapter source code repository270.

The API adapter execution file repository280is a repository of execution files of the API adapter, and the adapter generation unit119stores execution files of the API adapter generated by compiling in the API adapter execution file repository280.

Setting Processing of Logic and Parameter

The processing of steps S102and S103inFIG. 3will be described below with reference to the screens of the API adapter creation apparatus100illustrated inFIGS. 8 to 10, 12, 14, 15, 17, and 18, and the API execution order database230and the API parameter database250illustrated inFIGS. 6, 7, 11, 13, and 16. Specifically, details of logic and parameters defined (set) by a developing engineer and processing details of the API execution order setting unit112, the API execution condition setting unit113, the API iterative execution setting unit114, the API request parameter acquisition source setting unit115, the API response parameter reflection destination setting unit116, and the API request/response parameter design support unit117will be described.

Execution Order Setting

FIG. 8is a diagram illustrating an execution order setting screen400displayed by the API adapter creation apparatus100according to the present embodiment. A wholesale service API specification region410is displayed on the left upper side of the execution order setting screen400. A list of API name icons411and412of the wholesale service API is displayed in the wholesale service API specification region410. Note that the names displayed in the API name icons are one in which the method212is combined with the endpoint213of the API specifications229(seeFIG. 5) of the wholesale services.

A control component region421including an “if” icon422and a “for” icon423is displayed on the left lower side of the execution order setting screen400.

An adapter logic region431is displayed on the right side of the execution order setting screen400, The adapter logic region431is divided into a new adapter logic region432, a modification adapter logic region433, and a deletion adapter logic region434. Operations of a developing engineer in the new adapter logic region432, the modification adapter logic region433, and the deletion adapter logic region434and reflection of the execution order that is the result of the operations in the API execution order database230(seeFIG. 6) are similar regardless of the regions, except for the types232and252. Hereinafter, the new adapter logic region432will be described.

The developing engineer may drag the API name icons411and412provided in the wholesale service API specification region410and drop them into the new adapter logic region432to define an invocation order (execution order) of the wholesale service API. InFIG. 8, an execution order of “POST/auth” and “POST/network” is defined in this order.

The API execution order setting unit112stores the execution order defined in the new adapter logic region432in the API execution order database230as the records241and242inFIG. 6. Note that, the name of the adapter API is assumed to be “XXX” here. In the following description, the name of the adapter API is assumed to be “YYY.”

When a developing engineer clicks the “delete” button on the right side of the API name icon in the new adapter logic region432, the API execution order setting unit112deletes the API name icon and deletes the record corresponding to that in the API execution order database230.

Request Parameter Setting

FIG. 9is a diagram illustrating a parameter setting screen440displayed by the API adapter creation apparatus100according to the present embodiment. When a developing engineer clicks the “settings” button on the right side of the API name icon “POST/network” in the new adapter logic region432of the execution order setting screen400(seeFIG. 8), the API adapter creation apparatus100displays the parameter setting screen440.

When the developing engineer specifies a request parameters of the adapter API displayed in the input/output data region450, which is an acquisition source of the request parameters of the wholesale service API in the request parameter setting table470, the API request parameter acquisition source setting unit115displays a parameter serving as an acquisition source in the acquisition source474. For example, if the development engineer specifies that the acquisition source of the parameter “name” indicated in the record479is a parameter453“name” displayed in the input/output data region450, the API request parameter acquisition source setting unit115displays a parameter451“productOrder” including the parameter453“name” in the acquisition source474. Furthermore, the API request parameter acquisition source setting unit115reflects this specification (setting) in the API parameter database250(see the record262inFIG. 7).

Note that the name of the wholesale service API on the parameter setting screen440is the name in which the method212is combined with the endpoint213of the API specifications229(seeFIG. 5) of the wholesale service, like the “POST/network” on the name icon. On the other hand, the name of the wholesale service API in the API parameter database250(seeFIG. 7) is the API name211of the API specifications229of the wholesale service included in the processing253.

The developing engineer can specify the value of the request parameter, without specifying the acquisition source of the request parameter. At this time, the value is specified in the value475.

Response Parameter Setting

The response parameter setting table480is tabular data, in which one row (record) indicates one response parameter and includes columns (attributes) of object481, parameter482, type483, and reflection destination484. The API response parameter reflection destination setting unit116displays the object481, the parameter482, and the type483with reference to the response parameters219of the wholesale service API specification database210(seeFIG. 5).

When the developing engineer specifies a response parameter of the adapter API displayed in the input/output data region450, which is the reflection destination of the response parameters of the wholesale service API in the response parameter setting table480, the API response parameter reflection destination setting unit116displays the parameters of the reflection destination in the reflection destination484. For example, if the developing engineer specifies that the reflection destination of the parameter “id” indicated in the record489is a parameter455“id” displayed in the input/output data region450, the API response parameter reflection destination setting unit116displays a parameter454“product” including the parameter455“id” in the reflection destination484. Furthermore, the API response parameter reflection destination setting unit116reflects this specification (setting) in the API parameter database250(see the record264inFIG. 11, which will be described below).

FIG. 11is a diagram for describing the record264included in the API parameter database250according to the present embodiment. The record264indicates that, in invocation of the wholesale service API of “postNetwork” having the execution order of “4” (see the record246ofFIG. 6), a reflection destination of the parameter256“id” having the object255of the response parameter “Network” is “product.characteristic.network.id”of the adapter API.

Automatic Parameter Setting

As described inFIGS. 9 and 10, the developing engineer can specify, on the screen of the API adapter creation apparatus100, the acquisition source of the request parameters and the reflection destination of the response parameters of the wholesale service API. In a case in which the name of the request parameter of the wholesale service API matches the name of the request parameter of the adapter API that is an acquisition source, or a case in which the name of the response parameter of the wholesale service API matches the name of the response parameter of the adapter API that is a reflection destination, the acquisition source and the reflection destination can be set without being specified by the developing engineer.

If the object471“Network” is not defined below the parameter451“productOrder” which is a request parameter for the adapter API, the API request/response parameter design support unit117defines “productOrder.characteristic.network” which is a parameter of the object471type “Network”directly below “productORder.characteristic,” sets it as an acquisition source, and reflects it in the API parameter database250.

The API request/response parameter design support unit117likewise sets the reflection destination for the response parameters and reflects it in the API parameter database250.

FIG. 13is a diagram for describing the records262and265included in the API parameter database250according to the present embodiment. The record262has been described inFIG. 7. The record265indicates that, in invocation of the wholesale service API of “postNetwork” having the execution order of “4” (see the record246ofFIG. 6), an acquisition source of the parameter256“description” having the object255of the request parameter “Network” is “productOrder.characteristic.network.description”of the adapter API.

Conditional Execution Setting

FIG. 14is a diagram illustrating an execution order setting screen400A displayed by the API adapter creation apparatus100according to the present embodiment. Processing for defining conditional execution will be described with reference toFIG. 14.

In the new adapter logic region432illustrated inFIG. 8, invoking the wholesale service API is defined in the order of “POST/auth,” and “POST/network.” If “POST/network” is invoked (executed) conditionally, the developing engineer drags the icon422“if” and drops it between “POST/auth” and “POST/network” displayed in the new adapter logic region432. The API execution condition setting unit113detects this drop and moves and displays the API name icon “POST/network”one step to the right side to be displayed in the new adapter logic region432A ofFIG. 14to indicate conditional execution of “POST/network.” When the developing engineer clicks the “settings” button on the right side of the icon “if” in the new adapter logic region432A, the screen transitions to an execution condition setting screen491(seeFIG. 15, which will be described below) to define execution conditions.

FIG. 15is a diagram illustrating the execution condition setting screen491displayed by the API adapter creation apparatus100according to the present embodiment. The input/output data region450is displayed on the right side of the execution condition setting screen491, and an execution condition setting region492is displayed on the left side. The developing engineer combines parameters and constants (e.g., false values, numerical values, and character strings), comparison operators, numerical operators, functions, and the like present in the input/output data region450with each other, and defines formulas that are execution conditions in the execution condition setting region492. InFIG. 15, it is defined that a value of the parameter “productOrder.characteristic.network.enable” is true as an execution condition.

FIG. 16is a diagram for describing records of the API parameter database250according to the present embodiment. At the time point at which the developing engineer has defined the logic of the adapter API illustrated inFIGS. 14 and 15, records271to274are stored in the API execution order database230. In the new adapter logic region432A, processing is defined in order of “POST/auth,” “if,” and “POST/network,” and they correspond to the records271to273, respectively. Record274indicates an end of conditional execution shown in the record272. A formula for an execution condition defined in the execution condition setting region492(seeFIG. 15) is store in236in the additional information of the record272.

Iterative Execution Setting

FIG. 17is a diagram illustrating an execution order setting screen400B displayed by the API adapter creation apparatus100according to the present embodiment. Processing for defining iterative execution will be described with reference toFIG. 17.

In the new adapter logic region432A illustrated inFIG. 14, invoking the wholesale service API is defined in the order of “POST/auth” and “POST/network” of conditional execution. When “POST/network” of conditional execution is to be repeatedly performed, the developing engineer drags the icon423“for” and drops it between “POST/auth”and “if” displayed in the new adapter logic region432A. The API iterative execution setting unit114detects this drop and moves and displays the icon “if” and the API name icon “POST/network”one step to the right side to be displayed in the new adapter logic region432B ofFIG. 17to indicate that conditional execution of “POST/network” will be iteratively executed. When the developing engineer clicks the “settings” button on the right side of the icon “for” in the new adapter logic region432B, the screen transitions to an iteration condition setting screen495(seeFIG. 18, which will be described below) to define an iteration condition.

FIG. 18is a diagram illustrating the iteration condition setting screen495displayed by the API adapter creation apparatus100according to the present embodiment. The input/output data region450is displayed on the left side of the execution condition setting screen491, and an iteration condition setting region496is displayed on the right side. The developing engineer sets an iteration condition in the iteration condition setting region496by defining a parameter in the input/output data region450as an iteration variable. InFIG. 18, the parameter “productOrder.characteristic.network” is defined as an iteration variable. This parameter is a sequence and defines to repeat processing for each element of the sequence.

Once the developing engineer defines the logic of the adapter API shown inFIGS. 17, 15 and 18, the API execution order database230stores records243to248(seeFIG. 6). In the new adapter logic region432B (seeFIG. 17), processing is defined in order of “POST/auth,” “for,” “if,” and “POST/network,” and they correspond to the records243to246, respectively.

The record248indicates an end of iterative execution shown in the record244.236in the additional information of the record244stores an iteration variable defined in the iteration condition setting region496(seeFIG. 18).

Record247indicates an end of conditional execution shown in the record245. The additional information236in the record245stores a formula for an execution condition defined in the execution condition setting region492(seeFIG. 15).

Source Code Generation Process

FIG. 19is a flowchart showing a source code generation process performed by the source code generation unit118according to the present embodiment.FIG. 20is a flowchart showing a main body processing output process performed by the source code generation unit118according to the present embodiment. The main body output process refers to the process of step S204inFIG. 19.FIG. 21is a source code290generated by the source code generation unit118according to the present embodiment. Process of outputting the logic of the adapter API shown in the records243to248of the API execution order database230as the source code290will be described with reference toFIGS. 19 to 21. Note that the source code generation process is a process executed in step S104(seeFIG. 3).

Before the source code generation process is described, an overview of the source code290of the adapter API to be generated will be described. The adapter API is defined as a method of a class of object-oriented languages.

Row1is a class name declaration, and the rows from Row1describe a class definition (class description). Row28is the end row of the class definition. The class name includes adapter API name (see the API231inFIG. 6) and type (see the type232ofFIG. 6).

Row3is a method name declaration of a method that is an adapter API, and the rows from Row3are a method definition. Row27is the end row of the method definition. The definition of the method described below (Row5to Row26) is the logic of the adapter API, and the processing stored in the records243to248(seeFIG. 6) is output as the source code.

Row9is invocation of “postAuth” of the wholesale service API. Rows5through7are codes for generating a request parameter for “postAuth” prior to the invocation of “postAuth,” which sets a value of the request parameter (acquisition source) of the adapter API to the request parameter of “postAuth.” Rows11and12are codes for setting the response parameters of “postAuth” to the response parameter (reflection destination) of the adapter API.

Row14is the beginning of a for sentence including an iteration condition, and row26is the end of the for sentence.

Row15is the beginning of an if sentence including an execution condition, and row25is the end of the if sentence.

Rows16to24are processing included in the if sentence and include invocation of “postNetwork” of the wholesale service API of the row21, processing of the request parameters for the rows16to19, and processing of response parameters of the rows23to24.

In step S201ofFIG. 19, the source code generation unit118outputs a class name declaration row indicated in the row1of the source code290. “Add” of the class name “AddYYYProcess” included in the class name declaration row indicates that the adapter API is new (the type232ofFIG. 6is “A”). “YYY” is the name of the adapter API (see the API231ofFIG. 6).

In step S202, the source code generation unit118outputs a method name declaration row indicated in the row3of the source code290. “interactWithPartner” of the method name is a fixed name.

In step S203, the source code generation unit118repeats the main body processing output of step S204for each processing included in the logic of the adapter function. The processing included in the logic in the records243to248is the processing indicated in the records243and244. Because the processing indicated in the records245to247is the processing included in iterative processing of “for” indicated in the record244, it is not subjected to the iterative processing of step S203. Also, processing of the record248is the end of the iterative processing of the record244and it is performed as part of the main body output processing for the record244.

The main body processing output of step S204will be described inFIG. 20, which will be described below.

In step S205, the source code generation unit118determines whether step S204has been performed for all types of processing included in the logic of the adapter function. If step S204has been performed for all types of processing, the step proceeds to step S206, and if there is any remaining processing, step S204is performed for the next processing. The rows5to26of the source code290are output in the processing of steps S203to S205.

In step S206, the source code generation unit118outputs row27of the source code290that is the end row of the method definition.

In step S207, the source code generation unit118outputs row28of the source code290that is the end row of the class definition.

Source Code Generation Processing: Main Body Output Processing

Next, the main body output processing of the step S204will be described in detail with reference toFIG. 20. The main body output processing invokes the main body output processing of its own in steps S238and S243, and is recursive processing. Although, in the loop of steps S203to S205ofFIG. 19, the main body output processing is performed two times, including “postAuth” corresponding to the record243and “for” corresponding to the record244, self processing is invoked, and thus the main body output processing is performed more.

In step S231, the source code generation unit118proceeds to step S232if the processing type234(seeFIG. 6) is “API execution” (invocation of the wholesale service API) (step S231→API execution), proceeds to step S235if the processing type234is “control” and the processing235is “for” (step S231→for), and proceeds to step S241if the processing type234is “control” and the processing235is “if” (step S231→if).

In step S232, the source code generation unit118outputs a code to set the request parameters. In particular, the source code generation unit118refers to the record corresponding to the invoked wholesale service API included in the API parameter database250(seeFIG. 7) to generate the source code to set the request parameters of the adapter API to the request parameters of the wholesale service API.

Hereinafter, a case in which the main body output processing for “postAuth” of the record243is invoked will be described as an example. The source code generation unit118searches the API parameters database250(seeFIG. 7) for a record in which the processing253includes “postAuth” of the processing235of the record243and the execution order233of “1” and the parameter type254is “request.” Next, the source code generation unit118outputs a code to generate the object255of the search result record and a code to set the input source/reflection destination257to the parameter256of the object255included in the search result record. In the case of “postAuth” of the record243, a record261is retrieved to output the row5of source code290for generating the object and the row6for setting the parameters. The row7of the source code290is retrieved and output similarly to the record261. If the code to generate the object has been output, no code to generate the object is output.

In step S233, the source code generation unit118outputs a code to invoke the wholesale service API. In the “postAuth” of the record243, the source code generation unit118outputs the row9of the source code290.

In step S234, the source code generation unit118outputs a code to set the response parameters. Specifically, the source code generation unit118refers to a record corresponding to an invoked wholesale service API included in the API parameter database250to generate a source code to set the response parameters of the wholesale service API to the response parameters of the adapter API.

Hereinafter, a case in which the main body output processing for “postAuth” of the record243is invoked will be described as an example. The source code generation unit118searches the API parameters database250(seeFIG. 7) for a record in which the processing253includes “postAuth” of the processing235of the record243and the execution order233of “1” and the parameter type254is “response.” Next, the source code generation unit118outputs a code to acquire the object255of the search result record and a code to set the parameter256to a parameter of the input source/reflection destination257. In the case of “postAuth” in the record243, the record263is retrieved to output the row11of the source code to acquire AuthResponse of the object255and the row12to set the parameter256“apiToken” to the parameter of the input source/reflection destination257“internalData.apiToken.”

In step S235, the source code generation unit118generates an iteration control variable. Specifically, the source code generation unit118generates an iteration variable included in the additional information236.

Hereinafter, a case in which the main body output processing for “for” of the record244is invoked will be described as an example. The iteration variable in the additional information236of the record244is “productOrder.characteristic.network” and is a variable in the sequence. Thus, the source code generation unit118generates “i” which is an integer variable as a control variable representing an index of the sequence.

In step S236, the source code generation unit118outputs the for row. Specifically, the source code generation unit118outputs the generated control variable and the for row including the iteration variable in the additional information236.

Hereinafter, a case in which the main body output processing for “for” of the record244is invoked will be described as an example. The source code generation unit118has an initial value of 0 for the control variable, and outputs the row14of the source code290indicating repetition to “productOrder.characteristic.networklength” which is the length of the sequence of the iteration variable “productOrder.characteristic.network” while increasing the control variable by one.

In steps S237to239, the source code generation unit118repeats the main body output processing of step S238for each processing included in “for.” The processing included in “for” of the record244is only processing of “if” in the record245. The record246is the processing included in “if” in the record245, and the record247is the end of “if” in the record245. Thus, the source code generation unit118performs the main body output processing for the processing of the record245. This processing will be described in detail in steps S241to S245. Note that, in this processing, the rows15to25of the source code290are output. In step S240, the source code generation unit118outputs the end row. At “for” of the record244, the row26of the source code290is output.

In step S241, the source code generation unit118outputs if rows that include execution conditions. Hereinafter, a case in which the main body output processing for “if” of the record245is invoked will be described as an example. The execution condition for “if” in the record245is “productOrder.characteristic.network.enable=true” indicated in the additional information236, and the source code generation unit118outputs the row15of the source code290that includes this execution condition. Note that “productOrder.characteristic.network” included in the execution conditions is a sequence, and the row15is output including the control variable “i” output in the row14.

In steps S242to S244, the source code generation unit118repeats the main body output processing of step S243for each processing included in “if” The processing included in “if” of the record245is only processing of “postNework” in the record246. Thus, the source code generation unit118performs the main body output processing for the processing of the record246. This processing is similar to “postAuth” as described in steps S232to S234, and the rows16to24of source code290are output therein.

In step S245, the source code generation unit118outputs the end row. At “if” in the record245, the row25of source code290is output.

Characteristic of API Adapter Creation Apparatus

A developing engineer may define an order, execution conditions, and iteration conditions of a wholesale service API to be invoked by an adapter API, and define the relationship between the request and response parameters of the adapter API and the request and response parameters of the wholesale service API, and thereby can develop the API adapter. The developing engineer does not need to describe the source codes and can focus on study of the logic, which reduces the time required for the development and thus can deal with new wholesale services and specification changes in a short period of time.

The above-described definitions of the execution orders and the parameter relationships are design information, and thus there is no need to create specifications that are the design information. Furthermore, when the design information or the source code is changed, the other factor does not need to be modified. Mismatch between the design information and implementation (source code) does not occur.

REFERENCE SIGNS LIST

100API adapter creation apparatus

111Wholesale service API specification reference unit

112API execution order setting unit

113API execution condition setting unit

114API iterative execution setting unit

115API request parameter acquisition source setting unit

116API response parameter reflection destination setting unit

117API request/response parameter design support unit

118Source code generation unit

119Adapter generation unit