CN109086147A - Service interface call method, device and the storage medium of application program - Google Patents
Service interface call method, device and the storage medium of application program Download PDFInfo
- Publication number
- CN109086147A CN109086147A CN201810858538.4A CN201810858538A CN109086147A CN 109086147 A CN109086147 A CN 109086147A CN 201810858538 A CN201810858538 A CN 201810858538A CN 109086147 A CN109086147 A CN 109086147A
- Authority
- CN
- China
- Prior art keywords
- application program
- file
- header file
- user
- defined identification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/541—Client-server
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
This application discloses the service interface call methods and device of a kind of application program, comprising: obtains the application program user-defined identification for being respectively existing application program configuration and the respectively described existing application program accordingly generates the header file user-defined identification that header file configures;The corresponding header file of each existing application program is generated according to application program user-defined identification and the compiling of header file user-defined identification;Summarize to obtain target header file by what header file user-defined identification carried out all header files;It is compiled according to the target header file and generates sound code file;The calling of service interface in the existing application program is carried out by oss message corresponding to service interface in the existing application program.In the sound code file that compiling obtains, oss message corresponding to each service interface is configured according to application program user-defined identification, and then can intuitively find out there is which oss message in each application program very much, improves the readability of oss message.
Description
Technical field
This application involves field of software development, in particular to the service interface call method of a kind of application program, device and
Storage medium.
Background technique
In existing software development, single application program is difficult to complete whole work, it is therefore desirable to call other
Application program call required data information, in order to meet the calling of application program, existing application program provides
Free service interface is called for user, such as the application programs such as express delivery inquiry, weather forecast, railway timetable.
In order to realize the calling of the service interface in application program in the application, will be answered generally by compilation tool
The compiling of the service interface provided by program generates sound code file, includes each service interface in application program in the sound code file
Oss message, so that developer can compile resulting service interface correspondence by calling in process of application development
Oss message realize application program in service interface calling.In compiling obtained file, in multiple application programs
Oss message corresponding to each service interface is stored in a file, as shown in figure 11, although showing service interface
Corresponding oss message, i.e. interface function, if but some oss message in an application program and another application program
In oss message title it is approximate, i.e., the interface function name of two service interfaces is approximate, it is easy to cause programming personnel in software
Mistake inputs the oss message in exploitation, so that the error calls of service interface are caused, so the oss message that compiling generates
Readability need to be improved.
From the foregoing, it will be observed that the prior art has that the oss message readability obtained according to compiling of application is not high.
Summary of the invention
In order to solve the problems, such as present in the relevant technologies, this application provides a kind of service interface called sides of application program
Method, device and storage medium.
A kind of service interface call method of application program, comprising:
It obtains and is respectively the application program user-defined identification of existing application program configuration and respectively described has using journey
Sequence accordingly generates the header file user-defined identification of header file configuration;
According to the application program user-defined identification and the header file user-defined identification compiling generate it is each have answer
With the corresponding header file of program;
Summarize to obtain target header file, the target head by what the header file user-defined identification carried out all header files
File states the service interface that the existing application program is included according to the application program user-defined identification;
It is compiled according to the target header file and generates sound code file, the sound code file includes applying journey according to described respectively
Sequence user-defined identification is the oss message of service interface configuration in the existing application program;
It is carried out in the existing application program by oss message corresponding to service interface in the existing application program
The calling of service interface, oss message corresponding to service interface carries the existing application program in the existing application program
Corresponding application program user-defined identification.
A kind of service interface calling device of application program, comprising:
Obtain module, be configured as executing: obtaining is respectively the application program user-defined identification for having application program configuration
The respectively described existing application program accordingly generates the header file user-defined identification of header file configuration;
Header file generation module is configured as executing: according to the application program user-defined identification and the header file
User-defined identification compiling generates the corresponding header file of each existing application program;
Target head file generating module is configured as executing: carrying out all texts by the header file user-defined identification
Part summarizes to obtain target header file, the target header file according to application program user-defined identification statement it is described have answer
The service interface for being included with program;
Sound code file generation module is configured as executing: it is compiled according to the target header file and generates sound code file, it is described
It is that service interface configures in the existing application program that sound code file, which includes respectively according to the application program user-defined identification,
Oss message;
Calling module is configured as executing: passing through oss message corresponding to service interface in the existing application program
The calling of service interface in the existing application program is carried out, source code corresponding to service interface is believed in the existing application program
Breath carries application program user-defined identification corresponding to the existing application program.
In one embodiment, described device further include:
Variable configuration module is configured as executing: configuring application program variable and institute for each existing application program
The corresponding header file that generates configures header file variable;
Assignment module is configured as executing: it is the application program user-defined identification by the application program variable assignments,
And by the header file variable assignments be the header file user-defined identification.
In one embodiment, the header file generation module includes:
Header file generation unit is configured as executing: with the application program variable, the header file variable and described every
The uniform resource locator that application program corresponding to one existing application program describes file is parameter, is generated and is ordered using header file
Compiling generates the corresponding header file of each existing application program, and the entitled header file of the file of the header file is customized
Mark.
In one embodiment, described device further include:
Read module is configured as executing: it is corresponding that each existing application program is read from specified configuration file
The application program user-defined identification, the header file user-defined identification;
Uniform resource locator read module is configured as executing: reading from the specified configuration file described each
Application program corresponding to existing application program describes the uniform resource locator of file, and the specified configuration file is for providing institute
State the set and the unification of the set of application program user-defined identification, header file user-defined identification corresponding to existing application program
The set of Resource Locator.
In one embodiment, target head file generating module includes:
Target head file generating unit is configured as executing: customized with the header file corresponding to all header files
All header files are copied to the target by copy command by the entitled parameter of file of mark and the target header file
In header file, the target header file is obtained.
In one embodiment, sound code file generation module includes:
Designating unit is configured as executing: for sound code file designated document output folder;
Sound code file generation unit is configured as executing: with the filename of the target header file, the export folders
Filename and the path of the export folders be parameter, utilize sound code file to generate order compiling and generate source code text
Part, the sound code file are located in the export folders under the path.
In one embodiment, calling module includes:
Encapsulation unit is configured as executing: the sound code file and canonical function library file are encapsulated to application program;
Call unit is configured as executing: according to inputted in the application program after packaging it is described have answer
The oss message corresponding to service interface in program carries out the calling having using service interface in application program.
A kind of service interface calling device of application program, described device include:
Processor;And
Memory is stored with computer-readable instruction on the memory, and the computer-readable instruction is by the processing
Device realizes the process described above when executing
A kind of storage medium is stored thereon with computer program, when the computer program is executed by processor realize with
The upper method.
Technical solution provided by embodiments herein can include the following benefits: by for have application program
Configuration application program user-defined identification and the header file accordingly generated configuration header file user-defined identification, to be generated in compiling
In sound code file, oss message corresponding to each service interface is configured according to application program user-defined identification, and then can be with
Which oss message intuitively finds out very much in each application program has and wherein some oss message can intuitively be found out
Which application program belonged to, improves the readability of oss message, and clothes are called by the oss message convenient for programming personnel
Business interface.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and in specification together principle for explaining the present invention.
Fig. 1 is a kind of block diagram of device shown according to an exemplary embodiment;
Fig. 2 is a kind of flow chart of the service interface call method of application program shown according to an exemplary embodiment;
Fig. 3 is a kind of specific implementation details in embodiment illustrated in fig. 2 before step S110;
Fig. 4 is a kind of process of the service interface call method of the application program shown according to another exemplary embodiment
Figure;
Fig. 5 is a kind of process of the service interface call method for application program that property implementation exemplifies according to another embodiment
Figure;
Fig. 6 is a kind of process of the service interface call method for application program that property implementation exemplifies according to another embodiment
Figure;
Fig. 7 is an exemplary embodiment of step S170 in embodiment illustrated in fig. 2;
Fig. 8 is the flow chart of step S190 in embodiment illustrated in fig. 2;
Fig. 9 is a kind of block diagram of the service interface calling device of application program shown according to an exemplary embodiment;
Figure 10 is a kind of block diagram of the service interface calling device of application program shown according to an exemplary embodiment;
Figure 11 is the display schematic diagram that function interface is called in the application program of the compiled generation of the prior art;
Figure 12 is the display schematic diagram that function interface is called in the application program generated according to the present processes compiling;
Figure 13 is the schematic diagram of specified configuration file.
Specific embodiment
Here will the description is performed on the exemplary embodiment in detail, the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Referring to Fig. 1, Fig. 1 is a kind of block diagram of device shown according to an exemplary embodiment.Wherein device 100 can be used
In the service interface call method for the application program for executing the application, device 100 can be desktop computer, laptop,
This is without further limiting.It is worth noting that the device is only the example for adapting to the application, it is not construed as
Provide any restrictions to use scope of the present invention.The device 100 can not be construed to need to rely on or must have
One or more component in exemplary means 100 shown in Fig. 1.
As shown in Figure 1, device 100 (only shows one including memory 101, storage control 103, one or more in Fig. 1
It is a) processor 105, Peripheral Interface 107, radio-frequency module 109, locating module 111, photographing module 113, audio-frequency module 115, touch-control
Screen 117 and key module 119.These components are mutually communicated by one or more communication bus/signal wire 121.
Wherein, memory 101 can be used for storing computer program and module, as applied in exemplary embodiment of the present
Computer-readable instruction and module corresponding to the service interface call method and device of program, processor 105 are deposited by executing
The computer-readable instruction in memory 101 is stored up, thereby executing various functions and data processing, the i.e. service of application program
Interface call method.
The carrier that memory 101 is stored as resource, can be random access memory, for example high speed random access memory, it is non-easily
The property lost memory, such as one or more magnetic storage devices, flash memory or other solid-state memories.Storage mode can be short
Temporary storage permanently stores.
Peripheral Interface 107 may include an at least wired or wireless network interface, at least one series-parallel translation interface, at least
One input/output interface and at least USB interface etc., for coupleeing memory 101 for external various input/output devices
And processor 105, to realize the communication with external various input/output devices.
Radio-frequency module 109 is used for transceiving electromagnetic wave, the mutual conversion of electromagnetic wave and electric signal is realized, to pass through communication network
Network is communicated with other equipment.Communication network includes cellular telephone networks, WLAN or Metropolitan Area Network (MAN), above-mentioned communication network
Various communication standards, agreement and technology can be used in network.
Locating module 111 is used for the geographical location of acquisition device 100 being currently located.The example of locating module 111 includes
But it is not limited to GPS (GPS), the location technology based on WLAN or mobile radio communication.
Photographing module 113 is under the jurisdiction of camera, for shooting picture or video.The picture or video of shooting can be deposited
In storage to memory 101, host computer can also be sent to by radio-frequency module 109.
Audio-frequency module 115 provides a user audio interface, may include one or more microphone interfaces, one or more
Speaker interface and one or more earphone interfaces.The interaction of audio data is carried out by audio interface and other equipment.Sound
Frequency can also be sent according to can store to memory 101 by radio-frequency module 109.
Touch Screen 117 provides a display interface between device 100 and user, for showing that the input of user operates
And the output content of device.Specifically, user can carry out input operation by Touch Screen 117, such as click, touch, is sliding
It is dynamic to wait gesture operations, so that device 100 responds input operation.User can also be by connecting with Peripheral Interface 107
Keyboard, mouse etc. carry out input operation so that device 100 responds the input or clicking operation.Device 100 is then
Any one form of text, picture or video or combination are formed by output content and pass through Touch Screen 117 to user
Display output.
Key module 119 includes at least one key, to provide user's interface inputted to device 100, user
Device 100 can be made to execute different functions by pressing different keys.For example, switching on and shutting down key can for user open or
Person closes device 100.
It is appreciated that structure shown in FIG. 1 is only to illustrate, device 100 may also include more more or fewer than shown in Fig. 1
Component, or with the component different from shown in Fig. 1.Each component shown in Fig. 1 can use hardware, software or a combination thereof
To realize.
Fig. 2 is a kind of flow chart of the service interface call method of application program shown according to an exemplary embodiment.
As shown in Fig. 2, the service interface call method of the application program, can be executed by device 100, be may comprise steps of:
Step S110, obtaining is respectively to have the application program user-defined identification and be respectively to have to answer that application program configures
The header file user-defined identification of header file configuration is accordingly generated with program.
Existing application program, be independent platform, lower coupling, it is self-contained, based on programmable weblication, such as
The application programs such as express delivery inquiry, weather forecast, railway timetable, instant foreign exchange rate data, stock market data.
Application program user-defined identification be custom-configured for each existing application program be easily recognized, remember, distinguishing
Title, for example, if necessary to which the compiling of service interface provided by this application program of weather forecast is generated the source that can call
Code information can also be other then can configure application program user-defined identification " weather forecast " for the application program certainly
Convenient for the mark of identification, differentiation, memory.
Header file user-defined identification is that the header file accordingly generated for each existing application program custom-configures head text
Part title.By hereafter it is found that for each existing application program, compiling generates a header file.It is customized by header file
Mark is to distinguish the header file that each existing application program accordingly generates.
In one exemplary embodiment, as shown in figure 3, before step S110, further includes:
Step S010 configures application program variable for each existing application program and accordingly generates header file configuration head text
Part variable.
Application program variable assignments is application program user-defined identification by step S030, and by header file variable assignments
For header file user-defined identification.
The quantity for the existing application program wherein called as needed configures the quantity and header file of application program variable
The quantity of variable, for example, if needing that weather forecast and express delivery is called to inquire the two application programs, then corresponding configuration two
Application program variable and two header file variables.According to the customized mark of application program configured for each existing application program
Know, the application program user-defined identification which is configured.
It wherein configures application program variable and header file variable is for the ease of passing through application program in subsequent program
Variable carrys out access application user-defined identification, and header file user-defined identification is accessed by header file variable.So using journey
Sequence variable and header file variable, which can according to need, is configured to brief, easily distinguishable title.
In a specific embodiment, if existing application program is 3, the application program user-defined identification being respectively configured
It is respectively as follows: Service1, Service2, Service3, the corresponding header file user-defined identification being respectively configured are as follows:
generateHeader1.h,generateHeader2.h,generateHeader3.h.Correspondingly, being configured by application program
Application program variable are as follows: NAME1, NAME2, NAME3, the header file variable of configuration are Header1, Header2, Header3.
Step S010 and S030 can be realized by following procedure,
Set NAME1=Service1
Set NAME2=Service2
Set NAME3=Service3
Set Header1=generateHeader1.h
Set Header2=generateHeader2.h
Set Header3=generateHeader3.h
Wherein set NAME1=Service1, is represented to variable NAME1 assignment, which can be used to be expressed as having
The application program user-defined identification Service1 that application program I is configured.Other NAME2, NAME3 are similar with NAME1.
Wherein set Header1=generateHeader1, is represented to variable Header1 assignment, which is to have to answer
The header file user-defined identification of header file configuration, the i.e. filename of header file are accordingly generated with program I.Other Header2,
Header3 is similar with Header1.
Step S130, according to application program user-defined identification and header file user-defined identification compiling generate it is each have answer
With the corresponding header file of program.
Wherein header file is a kind of bearer documents stated comprising power function, data-interface.Each existing application program
Corresponding header file contains the attribute of the existing application program and the service interface for calling.
In order to compile the sound code file for generating existing application program, need to generate target data type using compilation tool
Sound code file.Compilation tool includes gSoap tool, soapsdk tool or winmport tool etc., wherein gSoap tool and
Soapsdk tool automatically generates the sound code file of C/C++ data type according to wsdl document, and winmport tool is according to WSDL text
Part automatically generates the sound code file of java data type.
The corresponding header file of each existing application program is generated specifically, compiling using compilation tool, is generated in compiling
It needs to describe file using to the application program of the existing application program during header file.It is base that application program, which describes file,
In the description language of network service, for describing network service and its function, parameter, return value and how to access to it.
The application program that the process for generating header file will have application program describes the head text that file compiling generates target data type
Part.
Application program, which describes file, can be wsdl document, and wsdl document is a kind of based on XML format progress application program
It describes and how to access to the application program, wherein including in the application program for tune for the description of application program
Service interface.Wsdl document is open source file, can be got according to corresponding application program, many common application programs
There is disclosed wsdl document, such as the wsdl document of weather forecast application program can be obtained from China Meteorological Administration website, express delivery
The corresponding wsdl documents of application programs such as inquiry, railway timetable, instant foreign exchange rate data can be obtained from corresponding channel.
Certainly the uniform resource locator of file can also be described by application program describes file, example come the application program that accesses
Such as, for the wsdl document of an existing application program, this can be accessed by the uniform resource locator of the wsdl document
Wsdl document.
So the difference and application program for the data type of required sound code file describe the type of file not
Together, used compilation tool is not also identical.
In one exemplary embodiment, gsoap compilation tool can be used to generate the header file of existing application program, such as
Shown in Fig. 4, step S130 includes:
Step S131 is retouched with application program corresponding to application program variable, header file variable and each existing application program
The uniform resource locator (URL) for stating file is parameter, generates order compiling using header file and generates each existing application program
Corresponding header file, the entitled header file user-defined identification of the file of header file.
The header file that wherein header file generates that order is gsoap generates order: wsdl2h.exe, wsdl2h.exe are
The included executable program of gsoap tool, effect are generated using wsdl document comprising existing application attribute and operation
The header file of C/C++ data type.Wherein header file generates the as follows using rule of order:
" wsdl2h.exe-N-o wsdl document name or URL "
Wherein, parameter "-N " indicates " ns " that default is replaced using namespace prefix;
Parameter "-o ", expression are output to file, i.e., the filename of the header file of specified output.
For three existing application programs mentioned above, this three can be generated respectively by following procedure have and answer
With the corresponding header file of program:
Wherein wsdl2h.exe-N %NAME1%-o %Header1% https: //xxx.com/xx? wsdl is held
After this section of program of row, represented by the entitled Header1 variable of header file file of the existing application program
GenerateHeader1.h, " ns " wherein defaulted in generateHeader1.h for the existing application program are applied
Program user-defined identification Service1 replacement, correspondingly, other two existing application programs " ns " that is defaulted also corresponding quilt
Application program user-defined identification Service2, Service3 replacement.
Step S150 summarizes to obtain target header file, target by what header file user-defined identification carried out all header files
Header file states the service interface that existing application program is included according to application program user-defined identification.
From the foregoing, it can be understood that in the header file that each existing application program accordingly generates, default for this application
" ns " mark is replaced by corresponding application program user-defined identification, so, after each header file is aggregated into target header file, answer
With including the application program user-defined identification, i.e. target header file is made by oneself according to application program in each service interface in program
Justice mark states the service interface that existing application program is included.
In one embodiment, as shown in fig. 6, step S150 includes:
Step S151, with the entitled ginseng of the file of header file user-defined identification and target header file corresponding to all header files
Number, all header files are copied in target header file, obtain target header file by copy command.
Wherein step S151 can be completed by following procedure:
copy generateHeader1.h+generateHeader2.h+generateHeader3.h all.h
Wherein copy is the included dos command of Windows, and effect is that one or more parts file is copied to another position
It sets, after executing the program, i.e., by generateHeader1.h, generateHeader2.h, generateHeader3.h tri-
Header file is aggregated into the header file of the entitled all.h of file.The header file of the all.h is target header file.
Step S170 is compiled according to target header file and is generated sound code file, and sound code file includes respectively according to application program
User-defined identification is the oss message of service interface configuration in existing application program.
In one exemplary embodiment, generating header file can be used gsoap tool, correspondingly, according to target header file
Compiling generates sound code file can use gsoap tool accordingly.As shown in fig. 7, step S170 includes:
Step S171 presss from both sides for sound code file designated document output;
Step S172, the path with the filename of target header file, the filename of export folders and export folders are
Parameter generates order compiling using sound code file and generates sound code file, and sound code file is located in the export folders under path.
In one exemplary embodiment, the included sound code file of gsoap tool generates the process that order generates sound code file
It is as follows:
" set outputdir=output
Mkdir%outputdir%
Soapcpp2.exe-C-L-x-n-I D: gsoap2.8.19 import-d%outputdir%all.h "
Wherein, set outputdir=output, is represented to variable outputdir assignment, which is used to indicate to export
The name of file.
Soapcpp2.exe is the executable program carried in gSoap tool, and as sound code file generates order, and effect is
Sound code file is generated from obtained header file (example a ll.h), using as follows:
Soapcpp2.exe command parameter header file
In example,
Command parameter option "-C ", expression only generate client code;
Command parameter "-L ", expression not generate soapClientLib.c and soapServerLib.c file;
Command parameter "-x ", expression not generate XML example file;
Command parameter "-n " indicates function, NameSpace that service is renamed using service name;
Command parameter "-I ", specifies the path of import, and example is " D: gsoap2.8.19 import ";
Command parameter "-d ", the path that appointment codes generate are the output file under current path in example.
After the completion of execution, after the completion of execution, the output at path " D: gsoap2.8.19 import " exports text
In part folder, it will including the sound code file according to target header file C/C++ format generated, wherein obtained source code text
Part includes:
soap.nsmap,soapC.cpp,soapClient.cpp,soapH.h,soapStub.h;
Wherein soap.nsmap is NameSpace definition code file;Sequence and the antitone sequence generation that soapC.cpp is soap
Code file;SoapClient.cpp is client code file;SoapH.h is server-side code file;SoapStub.h is
The stub file of soap.
Specifically, in soapStub.h file, i.e., it is customized according to set application program in the stub file of soap
Mark shows the oss message of service interface in each existing application program, and as shown in figure 12, the source code of each service interface is believed
Application program user-defined identification is configured in breath, so as to intuitively find out very much the corresponding oss message category of some service interface
Which has application program in, for a specific existing application program, can intuitively find out can including which oss message
For calling.
Step S190 is carried out in existing application program by oss message corresponding to service interface in existing application program
The calling of service interface has oss message corresponding to service interface in application program and carries corresponding to existing application program
Application program user-defined identification.
One of service interface corresponding one carries the application program of existing application program belonging to the service interface certainly
Definition mark, in the application by the way that the corresponding oss message of the service interface for needing to call is added to the application program
In, then the calling of service interface in the corresponding application program of oss message can be realized in the application program when being executed, wherein
The oss message being added in application program can be (such as the application of the corresponding oss message of multiple service interfaces institute
Multiple service interfaces in multiple service interfaces or multiple application programs in program).
By the corresponding application program user-defined identification of existing application program entrained in oss message, so as to straight
Connect according to oss message be clear from the oss message corresponding to service interface be that application program service interface, improve
The readability of program.
In one exemplary embodiment, as shown in figure 8, step S190 includes:
Step S191 encapsulates sound code file and canonical function library file to application program.
Wherein canonical function library file is the canonical function library file of used compilation tool, for the compiling work used
Tool is different, and canonical function library file is not also identical.For using gsoap tool, by gsoap tool stdsoap2.h,
The two canonical function library files of stdsoap2.cpp are encapsulated to application program.Wherein stdsoap2.h file is standard soap association
The header file of view, stdsoap2.cpp file are the source files of standard soap agreement.The encapsulation of two canonical function library files
Provide the bottom layer realization of soap protocol related function, such as soap network connection, communication, XML parsing, serializing and antitone sequence
Change the bottom layer realization of data structure of C/C++ etc..
From the foregoing, it can be understood that compiling generate sound code file include: soap.nsmap, soapC.cpp,
soapClient.cpp,soapH.h,soapStub.h.It will four sound code files and canonical function library text mentioned above
Part is sealed into application program.
Step S192, according to corresponding to service interface in the existing application program inputted in application program after packaging
Oss message, had the calling using service interface in application program.
Oss message corresponding to service interface inputs as needed in the existing program service wherein inputted, i.e.,
It needs which service interface is called to input corresponding oss message, service corresponding to the oss message is carried in oss message and is connect
Mouthful belonging to have application program application program user-defined identification, thus input when and can be clear when checking application program
Service interface Chu Zhidao to be called is the service interface in that existing application program, improves programming efficiency.
It is inputted in application program after packaging in existing application program after oss message corresponding to service interface, then
The calling of the corresponding service interface of inputted oss message can be realized in the application program when being executed.
By configuring application program user-defined identification, header file user-defined identification, existing application program is generated in compiling
After sound code file, the oss message of service interface includes the application program user-defined identification in application program, thus soft project
Teacher can be intuitively from recognizing in each existing application program specifically have which oss message can in obtained stub file
For calling, and which application program is belonged to for the wherein corresponding oss message of a certain service interface, improves sound code file
Readability, specific service interface is called by oss message convenient for software engineer.
In one exemplary embodiment, as shown in figure 5, before step S030, the method for the embodiment further include:
Step S020 reads the corresponding customized mark of application program of each existing application program from specified configuration file
Know, header file user-defined identification;
In this embodiment, before step S131, further includes:
Step S210 reads application program corresponding to each existing application program from specified configuration file and describes file
Uniform resource locator, specified configuration file is for providing the collection of application program user-defined identification corresponding to existing application program
It closes, the set of the set of header file user-defined identification and uniform resource locator.
Specifically, specified configuration file can be as shown in figure 13, certainly, which is only to adapt to the application's
Illustrative diagram is not construed as the limitation to the application use scope.Wherein, the specified configuration file shown in Figure 13
In, the information of each existing application program records information with the section that a bracket represents, for example,
[WebServiceInfo1] represents the information of an existing application program 1, at [WebServiceInfo1], Name=
Service1 is expressed as application program the user-defined identification Service1, Header=that the existing application program 1 configures
GenerateHeader1.h is expressed as the header file configuration header file user-defined identification that the existing application program 1 accordingly generates
GenerateHeader1.h, WSDL=https: //xxx.com/xx? wsdl indicates WSDL text corresponding to the existing application program
The uniform resource locator (URL) of part.
Read from specified configuration file for each existing application program configuration application program user-defined identification and
After header file user-defined identification, according to the application program variable and header file variable configured, above-described embodiment can be executed
Step S030 and step S110.Application program corresponding to each existing application program is read in the configuration file specified from this
After the uniform resource locator for describing file, step S130 (or step S131) and its later step are executed.
By specified configuration file as the interactive interface with user (such as software engineer), user is in interactive interface
Each existing application program configuration application program user-defined identification, header file user-defined identification and corresponding application program description text
The uniform resource locator of part.Executable program is configured by the service interface call method of the application application program, thus with
Family inputs relevant information (as existing application program configuration application program user-defined identification, header file in specified configuration file
User-defined identification and corresponding application program describe the uniform resource locator of file), by executing the executable journey configured
Sequence, so that it may obtain the sound code file of existing application program, and the sound code file includes respectively according to the customized mark of application program
Know the oss message for service interface configuration in existing application program.
Following is the application Installation practice, and the service interface that can be used for executing the above-mentioned application program of the application calls
Embodiment of the method.For undisclosed details in the application Installation practice, the service interface of the application application program is please referred to
Call method embodiment.
Fig. 9 is a kind of block diagram of the service interface calling device of application program shown according to an exemplary embodiment, should
Device can be used in device 100 shown in FIG. 1, and the service interface for executing application program shown in any of the above embodiment calls
The all or part of step of method.As shown in figure 9, the service interface calling device of the application program includes but is not limited to: obtaining
Modulus block 110, header file generation module 130, target head file generating module 150, sound code file generation module 170 and calling
Module 190, in which:
Obtain module 110, be configured as executing: obtaining is respectively the customized mark of application program for having application program configuration
Know and respectively existing application program accordingly generates the header file user-defined identification that header file configures.
Header file generation module 130, the module connect with module 110 is obtained, are configured as executing: certainly according to application program
Definition mark and the compiling of header file user-defined identification generate the corresponding header file of each existing application program.
Target head file generating module 150, the module are connect with header file generation module 130, are configured as executing: be passed through
What header file user-defined identification carried out all header files summarizes to obtain target header file, and target header file is made by oneself according to application program
Justice mark states the service interface that existing application program is included.
Sound code file generation module 170, the module are connect with target head file generating module 150, are configured as executing: root
It is compiled according to target header file and generates sound code file, it is to have application that sound code file, which includes respectively according to application program user-defined identification,
The oss message that service interface configures in program.
Calling module 190, the module are connect with sound code file generation module 170, are configured as executing: by having application
Oss message corresponding to service interface carries out the calling of service interface in the existing application program in program, has using journey
Oss message corresponding to service interface carries application program user-defined identification corresponding to the existing application program in sequence.
In one embodiment, the service interface calling device of application program further include:
Variable configuration module is configured as executing: configuring application program variable for each existing application program and institute is corresponding
It generates header file and configures header file variable.
Assignment module is configured as executing: being application program user-defined identification by application program variable assignments, and by head
File variable is assigned a value of header file user-defined identification.
In one embodiment, header file generation module includes:
Header file generation unit is configured as executing: with application program variable, header file variable and each having using journey
The uniform resource locator that application program corresponding to sequence describes file is parameter, and it is each to generate order compiling generation using header file
The existing corresponding header file of application program, the entitled header file user-defined identification of the file of header file.
In one embodiment, the service interface calling device of application program further include:
Read module is configured as executing: the corresponding application of each existing application program is read from specified configuration file
Program user-defined identification, header file user-defined identification.
Uniform resource locator read module is configured as executing: reading from specified configuration file and each has application
Application program corresponding to program describes the uniform resource locator of file, and specified configuration file is for providing existing application program institute
Set, the set of header file user-defined identification and the set of uniform resource locator of corresponding application program user-defined identification.
In one embodiment, target head file generating module includes:
Target head file generating unit is configured as executing: with header file user-defined identification corresponding to all header files
With the entitled parameter of file of target header file, all header files are copied in target header file by copy command, obtain mesh
Header file.
In one embodiment, sound code file generation module includes:
Designating unit is configured as executing: for sound code file designated document output folder.
Sound code file generation unit is configured as executing: with the filename of target header file, the filename of export folders
Path with export folders is parameter, generates order compiling using sound code file and generates sound code file, sound code file is located at road
In export folders under diameter.
In one embodiment, in one embodiment, calling module includes:
Encapsulation unit is configured as executing: sound code file and canonical function library file are encapsulated to application program.
Call unit is configured as executing: according in the existing program service inputted in application program after packaging
Oss message corresponding to service interface carries out the calling of service interface in existing application program service.
The realization process of the function and effect of modules or unit is specifically detailed in above-mentioned application program in above-mentioned apparatus
Service interface call method in correspond to the realization process of step, details are not described herein.
Above-mentioned modules or unit are also possible to functional module, for executing the service interface tune of above-mentioned application program
With the correspondence step in method.It is appreciated that these modules or unit can by hardware, software, or a combination of both realize.
When realizing in hardware, these modules or unit may be embodied as one or more hardware modules, such as one or more
Specific integrated circuit.When being realized with software mode, these modules or unit be may be embodied as on the one or more processors
One or more computer programs of execution, such as the program being stored in performed by the processor 105 of Fig. 1 in memory 101.
In the exemplary embodiment, a kind of service interface calling device of application program is additionally provided, as shown in Figure 10, packet
It includes:
Processor 1001;And
Memory 1002 is stored with computer-readable instruction 1002 on memory, and computer-readable instruction 1002 is processed
The service interface call method of application program in the various embodiments described above is realized when device 1001 executes.
The processor of device in the embodiment executes the concrete mode of operation in the service in relation to the application program
Detailed description is performed in the embodiment of interface call method, no detailed explanation will be given here.
In the exemplary embodiment, a kind of storage medium is additionally provided, computer program is stored thereon with, the storage medium
It for computer readable storage medium, such as can be the provisional and non-transitorycomputer readable storage medium for including instruction,
The service interface call method of application program in above method embodiment is realized when computer program is executed by processor.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and change can executed without departing from the scope.The scope of the present invention is limited only by the attached claims.
Claims (10)
1. a kind of service interface call method of application program characterized by comprising
Obtain the application program user-defined identification for being respectively existing application program configuration and the respectively described existing application program institute
The corresponding header file user-defined identification for generating header file configuration;
It generates and each has using journey according to the application program user-defined identification and header file user-defined identification compiling
The corresponding header file of sequence;
Summarize to obtain target header file, the target header file by what the header file user-defined identification carried out all header files
The service interface that the existing application program is included is stated according to the application program user-defined identification;
According to the target header file compile generate sound code file, the sound code file include respectively according to the application program from
Definition is identified as the oss message that service interface configures in the existing application program;
Service in the existing application program by oss message corresponding to service interface in the existing application program
The calling of interface.
2. the method according to claim 1, wherein the acquisition is respectively the application of existing application program configuration
Program user-defined identification and the respectively described existing application program accordingly generate the header file user-defined identification of header file configuration
Before, further includes:
It configures application program variable for each existing application program and accordingly generates header file and configure header file variable;
It is the application program user-defined identification by the application program variable assignments, and is by the header file variable assignments
The header file user-defined identification.
3. according to the method described in claim 2, it is characterized in that, described according to the application program user-defined identification and head
File user-defined mark compiling generates the corresponding header file of each existing application program, comprising:
With the description of application program corresponding to the application program variable, the header file variable and each existing application program
The uniform resource locator of file is parameter, and it is corresponding to generate order compiling generation each existing application program using header file
Header file, the entitled header file user-defined identification of the file of the header file.
4. according to the method described in claim 3, it is characterized in that, it is described by the application program variable assignments be the application
Program user-defined identification, and by the header file variable assignments for before the header file user-defined identification, further includes:
The corresponding application program user-defined identification of each existing application program, described is read from specified configuration file
Header file user-defined identification;
It is described with application program corresponding to the application program variable, the header file variable and each existing application program
The uniform resource locator for describing file is parameter, generates order compiling using header file and generates each existing application program
Before corresponding header file, further includes:
The unification that application program corresponding to each existing application program describes file is read from the specified configuration file
Resource Locator.
5. the method according to claim 1, wherein described owned by the header file user-defined identification
Header file summarizes to obtain target header file, comprising:
With the entitled parameter of file of header file user-defined identification corresponding to all header files and the target header file, lead to
It crosses copy command to copy to all header files in the target header file, obtains the target header file.
6. the method according to claim 1, wherein described compile to the target header file generates source code text
Part, comprising:
For sound code file designated document output folder;
It is ginseng with the path of the filename of the target header file, the filename of the export folders and the export folders
Number generates order compiling using sound code file and generates the sound code file, and the sound code file is located at described under the path
In export folders.
7. method according to any one of claims 1 to 6, which is characterized in that described by the existing application program
Oss message corresponding to service interface carries out the calling of service interface in the existing application program, comprising:
The sound code file and canonical function library file are encapsulated to application program;
According to source corresponding to service interface in the existing application program inputted in the application program after packaging
Code information, carries out the calling of service interface in the existing application program.
8. a kind of service interface calling device of application program characterized by comprising
Obtain module, be configured as executing: acquisition is respectively the application program user-defined identification of existing application program configuration and divides
The header file user-defined identification of header file configuration is not generated accordingly for the existing application program;
Header file generation module is configured as executing: being made by oneself according to the application program user-defined identification and the header file
Justice mark compiling generates the corresponding header file of each existing application program;
Target head file generating module is configured as executing: carrying out all header files by the header file user-defined identification
Summarize to obtain target header file, the target header file has according to application program user-defined identification statement is described using journey
The service interface that sequence is included;
Sound code file generation module is configured as executing: being compiled according to the target header file and generates sound code file, the source code
File includes the source code configured respectively according to the application program user-defined identification for service interface in the existing application program
Information;
Calling module is configured as executing: being carried out by oss message corresponding to service interface in the existing application program
The calling of service interface in the existing application program.
9. a kind of service interface calling device of application program, which is characterized in that described device includes:
Processor;And
Memory is stored with computer-readable instruction on the memory, and the computer-readable instruction is held by the processor
The method as described in any one of claims 1 to 7 is realized when row.
10. a kind of storage medium, is stored thereon with computer program, which is characterized in that the computer program is held by processor
The method as described in any one of claims 1 to 7 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810858538.4A CN109086147B (en) | 2018-07-31 | 2018-07-31 | Service interface calling method and device of application program and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810858538.4A CN109086147B (en) | 2018-07-31 | 2018-07-31 | Service interface calling method and device of application program and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109086147A true CN109086147A (en) | 2018-12-25 |
CN109086147B CN109086147B (en) | 2022-02-22 |
Family
ID=64831114
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810858538.4A Active CN109086147B (en) | 2018-07-31 | 2018-07-31 | Service interface calling method and device of application program and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109086147B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949249A (en) * | 2019-05-14 | 2020-11-17 | 百度(美国)有限责任公司 | Universal verification method for Protobuf-based projects |
CN111985055A (en) * | 2020-08-28 | 2020-11-24 | 北京世冠金洋科技发展有限公司 | Model packaging method and device and electronic equipment |
CN114327415A (en) * | 2022-03-17 | 2022-04-12 | 武汉天喻信息产业股份有限公司 | Compiling method and device for compiling java file |
CN114760290A (en) * | 2022-05-07 | 2022-07-15 | 北京字跳网络技术有限公司 | Application development method and device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5790861A (en) * | 1995-07-07 | 1998-08-04 | Sun Microsystems, Inc. | Method and apparatus for generating executable code from object-oriented C++ source code |
US8806453B1 (en) * | 2011-09-15 | 2014-08-12 | Lockheed Martin Corporation | Integrating disparate programming languages to form a new programming language |
CN105786498A (en) * | 2016-02-25 | 2016-07-20 | 广州阿里巴巴文学信息技术有限公司 | Method and device for modifying application and electronic device |
CN106528171A (en) * | 2016-11-24 | 2017-03-22 | 郑州云海信息技术有限公司 | Method, device and system for designing interface between heterogeneous computing platforms |
CN107291480A (en) * | 2017-08-15 | 2017-10-24 | 中国农业银行股份有限公司 | A kind of function calling method and device |
CN108197440A (en) * | 2017-11-28 | 2018-06-22 | 五八有限公司 | A kind of Code obfuscation method, equipment and computer readable storage medium |
-
2018
- 2018-07-31 CN CN201810858538.4A patent/CN109086147B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5790861A (en) * | 1995-07-07 | 1998-08-04 | Sun Microsystems, Inc. | Method and apparatus for generating executable code from object-oriented C++ source code |
US8806453B1 (en) * | 2011-09-15 | 2014-08-12 | Lockheed Martin Corporation | Integrating disparate programming languages to form a new programming language |
CN105786498A (en) * | 2016-02-25 | 2016-07-20 | 广州阿里巴巴文学信息技术有限公司 | Method and device for modifying application and electronic device |
CN106528171A (en) * | 2016-11-24 | 2017-03-22 | 郑州云海信息技术有限公司 | Method, device and system for designing interface between heterogeneous computing platforms |
CN107291480A (en) * | 2017-08-15 | 2017-10-24 | 中国农业银行股份有限公司 | A kind of function calling method and device |
CN108197440A (en) * | 2017-11-28 | 2018-06-22 | 五八有限公司 | A kind of Code obfuscation method, equipment and computer readable storage medium |
Non-Patent Citations (2)
Title |
---|
汤俊等: "自编头文件的C-MEX混合编程", 《机械制造与自动化》 * |
龙娟等: "基于ObjectARX 自定义实体的冒口系统参数化设计", 《铸造技术》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949249A (en) * | 2019-05-14 | 2020-11-17 | 百度(美国)有限责任公司 | Universal verification method for Protobuf-based projects |
CN111949249B (en) * | 2019-05-14 | 2023-12-01 | 百度(美国)有限责任公司 | Universal verification method for Protobuf-based project |
CN111985055A (en) * | 2020-08-28 | 2020-11-24 | 北京世冠金洋科技发展有限公司 | Model packaging method and device and electronic equipment |
CN111985055B (en) * | 2020-08-28 | 2023-08-08 | 北京世冠金洋科技发展有限公司 | Model packaging method and device and electronic equipment |
CN114327415A (en) * | 2022-03-17 | 2022-04-12 | 武汉天喻信息产业股份有限公司 | Compiling method and device for compiling java file |
CN114760290A (en) * | 2022-05-07 | 2022-07-15 | 北京字跳网络技术有限公司 | Application development method and device, electronic equipment and storage medium |
CN114760290B (en) * | 2022-05-07 | 2024-04-12 | 北京字跳网络技术有限公司 | Application development method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109086147B (en) | 2022-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109614823B (en) | Data processing method, device and equipment | |
CN109086147A (en) | Service interface call method, device and the storage medium of application program | |
EP3502896A1 (en) | Generation of an adapters configuration user interface | |
CN111552838B (en) | Data processing method and device, computer equipment and storage medium | |
CN108337236A (en) | A kind of gRPC call methods and device based on Protobuf and HTTP/1.1 | |
CN114981775B (en) | Cloud-based API metadata management method and system for integrated API management | |
CN106559251A (en) | A kind of Compilation Method and corresponding interface, component and system based on YANG models | |
CN109240688A (en) | Interface development method, electronic device and readable storage medium storing program for executing | |
CN103150154B (en) | The implementation method and device of a kind of application plug | |
CN109062626A (en) | Exchange method, device and the equipment of Web page component and Native component | |
TWI727501B (en) | Wireless communication core network and method for analyzing mobility of user equipment in the same | |
CN104717647B (en) | Professional ability method for authenticating, equipment and system | |
CN107870989A (en) | webpage generating method and terminal device | |
CN110321283A (en) | Interface testing case generation method, device, computer installation and storage medium | |
CN107450993A (en) | A kind of data interactive method of distributed IEC61850 communication components | |
CN109976793A (en) | A kind of operation method of application program, device, equipment and medium | |
CN109726217A (en) | A kind of database operation method, device, equipment and storage medium | |
CN109814863A (en) | A kind of processing method, device, computer equipment and computer storage medium for requesting returned data | |
CN109947431A (en) | A kind of code generating method, device, equipment and storage medium | |
CN109446648A (en) | Service of simulation method for building up and device | |
CN110888794B (en) | Interface testing method and device | |
CN104182228A (en) | Method and system for creating network applications | |
CN112988872B (en) | Interface document management method and device, storage medium and electronic equipment | |
CN104378393A (en) | Resource sharing method and corresponding device | |
CN112000876B (en) | Information display method, terminal and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |