CN102255961A - Java 2 micro edition (J2ME)-based Web Service interface calling method - Google Patents

Java 2 micro edition (J2ME)-based Web Service interface calling method Download PDF

Info

Publication number
CN102255961A
CN102255961A CN2011101820396A CN201110182039A CN102255961A CN 102255961 A CN102255961 A CN 102255961A CN 2011101820396 A CN2011101820396 A CN 2011101820396A CN 201110182039 A CN201110182039 A CN 201110182039A CN 102255961 A CN102255961 A CN 102255961A
Authority
CN
China
Prior art keywords
web service
xml
j2me
interface
service interface
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
Application number
CN2011101820396A
Other languages
Chinese (zh)
Other versions
CN102255961B (en
Inventor
黄明春
梅林�
赵思扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Singularity Xinyuan International Technology Development (Beijing) Co.,Ltd.
Original Assignee
CHONGQING XINMEI AGRICULTURAL INFORMATION TECHNOLOGY CO LTD
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by CHONGQING XINMEI AGRICULTURAL INFORMATION TECHNOLOGY CO LTD filed Critical CHONGQING XINMEI AGRICULTURAL INFORMATION TECHNOLOGY CO LTD
Priority to CN2011101820396A priority Critical patent/CN102255961B/en
Publication of CN102255961A publication Critical patent/CN102255961A/en
Application granted granted Critical
Publication of CN102255961B publication Critical patent/CN102255961B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)

Abstract

The invention provides a Java 2 micro edition (J2ME)-based Web Service interface calling method. In the method, an extensive markup language (XML) encoder and an XML decoder are constructed on a J2ME platform for Web Service interface calling request application processing and XML-format Web Service data resolution processing to realize the Web Service interface calling of the J2ME platform, so that mobile terminals with JAVA virtual machines all can realize a Web Service interface calling function; and the conventional mobile terminals in the market generally support the J2ME platform, thereby solving the problem of general applicability in value added services developed by calling Web Service interfaces by the mobile terminals. By the scheme provided by the invention, the value added services can be run on all the mobile terminals supporting the JAVA virtual machines only by development on the J2ME platform, and are not required to be repeatedly developed for different mobile terminal system platforms, so the development cost of the value added services is reduced.

Description

Call the method for Web Service interface based on J2ME
Technical field
The present invention relates to J2ME technology and Web Service communication technical field, particularly a kind of method of calling Web Service interface based on J2ME.
Background technology
Along with the develop rapidly of communication technical field and popularizing of portable terminal, the portable terminal value-added service has also incorporated people's life gradually, the value-added service that provides by the service provider, people can carry out information browse and exchange whenever and wherever possible, greatly facilitate people's life, study and work.People's rhythm of life is in continuous quickening, the frequency of information updating is more and more faster, people are also more and more higher to the requirement of instant messages, the value-added service information data that upgrades in time then become guarantee value-added service service quality, strengthen the value-added service competitive advantage the problem that must face.Be accompanied by the continuous lifting of mobile communication network transmission speed, become possibility by mobile terminal accessing Internet network, if allow portable terminal obtain the value-added service information data by mode and the Web Service server communication in the Internet network that calls Web Service interface, then only need to upgrade the data in the Web Service server, portable terminal just can obtain the value-added information data, services of latest data at any time, so portable terminal calls Web Service interface function and becomes new R﹠D direction in the communications field.
At present comparatively common in the system platform that portable terminal is used have Android, Windows Mobile, symbian, Linux, Palm, BlackBerry, a MTK etc., and the system platform of the used portable terminal of different user is not quite similar.On the different mobile terminal system platform, realize the operation of Web Service interface interchange, because transplantability is relatively poor between the different system platform, want to allow general user's portable terminal all by calling Web Service interface developing value-added services, just need carry out the program development of Web Service interface interchange respectively, will cause development cost very high at different system platform; And the program development difficulty that realizes the operation of Web Service interface interchange on the different system platform is also different, require developer's understanding suitable to the mobile terminal system platform, so development technique personnel's requirement is also quite high.Because the restriction of above-mentioned factor, portable terminal is difficult to generally be applicable to all users by the operation way that calls Web Service interface developing value-added services always.
Summary of the invention
At above shortcomings in the prior art, the present invention is in order to solve the general applicability problem that portable terminal calls Web Service interface, a kind of method of calling Web Service interface based on J2ME is proposed, make the portable terminal that the JAVA virtual machine is installed can both realize Web Service interface interchange function by this method, thus allow user's portable terminal can be general pass through to call Web Service interface developing value-added services.
For achieving the above object, the present invention has adopted following technological means:
Call the method for Web Service interface based on J2ME, at J2ME platform construction XML compiler and XML interpreter; Call the interface IP address and the call parameters of Web Service interface in advance in the setting of J2ME platform, the XML compiler then generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters; The J2ME platform sends the request of described Web Service interface interchange by communication network to Web Service server then, after wait gets access to the Web Service service data of the XML form that Web Service server returns, by the XML interpreter described Web Service service data is interpreted as the J2ME file, shows processing by the J2ME platform.
But as a kind of selection scheme, described XML compiler mainly is made of compiling function reference table and call request generation module; Described compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function; Described call request generation module generates the Web Service interface interchange request of XML form according to the soap protocol structure, in the construction process, by query compiler function reference table, get the interface IP address that call Web Service interface of the value of XML interface IP address function in the request of Web Service interface interchange, get the call parameters of calling Web Service interface of the value of XML call parameters function in the request of Web Service interface interchange for the input of J2ME platform for the input of J2ME platform.
But as a kind of selection scheme, described XML compiler mainly please be sought template and compile the functional value extraction module and be constituted by compiling function reference table, Web Service interface interchange; Described compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function; The Web Service interface interchange request XML file template that described Web Service interface interchange please seek template and be based on soap protocol; Described compiling functional value extraction module extracts Web Service interface interchange and please seek template, and query compiler function reference table, the value of XML interface IP address function during the interface IP address that calls Web Service interface of extraction J2ME platform input please seek template as Web Service interface interchange, the value of XML call parameters function generated the Web Service interface interchange request of XML form during the call parameters of calling Web Service interface of extraction J2ME platform input please seek template as Web Service interface interchange.
But as a kind of selection scheme, described XML interpreter mainly is made of the decipher statement table of comparisons and statement interpretation module; The described decipher statement table of comparisons records the contrast relationship of XML structured statement and J2ME structured statement; Described statement interpretation module is by the inquiry decipher statement table of comparisons, and the XML structured statement that constitutes the Web Service service data that Web Service server returns is interpreted as the J2ME structured statement, obtains the J2ME file of Web Service service data.
But as a kind of selection scheme, described XML interpreter mainly is made of decipher function reference table, Web Service service data indicating template and decipher functional value extraction module; Described decipher function reference table record has XML to call result function and J2ME calls the corresponding relation of explicit function as a result; It is the function that Web Service interface gained service result is called in expression in the Web Service service data returned of Web Service server that described XML calls result function; J2ME calls as a result, and explicit function is that the expression display object is to call the function of Web Service interface gained service result in the Web Service service data indicating template; Described Web Service service data indicating template is the J2ME file template of the contained information of Web Service service data that is used for showing that Web Service server returns; Described decipher functional value extraction module extracts Web Service service data indicating template, and inquiry decipher function reference table, extract the value that XML in the Web Service service data that Web Service server returns calls result function and call the value of explicit function as a result, obtain including the J2ME file that calls Web Service interface gained service result as J2ME in the Web Service service data indicating template.
In the such scheme, further, call the interface IP address and call parameters of Web Service interface in the setting of J2ME platform after, the J2ME platform also detects communication network connection situation, judges whether connect communication network surpasses preset time T 0 and do not have response; If then the prompting networking is overtime; If not, carry out the XML compiler generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters step again.
Than prior art, the present invention has following beneficial effect:
1, the inventive method has realized the Web Service interface interchange function of J2ME platform, and at present on the market portable terminal is all generally supported the J2ME platform, thereby has solved portable terminal by calling the general applicability problem of Web Service interface developing value-added services.
2, the present invention program only needs to develop at the J2ME platform, can move on all support the portable terminal of JAVA virtual machine, need not to carry out overlapping development at the different mobile terminal system platform, greatly reduces the value-added service development cost.
3, in the inventive method, the scheme that adopts the XML compiler structure that mainly is made of compiling function reference table and call request generation module to generate the request of Web Service interface interchange is used more flexibly, scalability is stronger, but to the handling property of portable terminal and having relatively high expectations of memory property; Adopt mainly by compiling function reference table, Web Service interface interchange please seek template and compile XML compiler assembly unit that the functional value extraction module constitutes generate the scheme running of Web Service interface interchange request simple more, carry out the efficient height, requirement to portable terminal handling property and memory property is also relatively low, it is relatively poor just to quote flexibility, is applicable to the value-added service of customization.In using, concrete value-added service can select suitable XML compiler according to the needs of actual conditions.
4, in the inventive method, adopt mainly the scheme of the XML interpreter decipher Web Service service data that constitutes by the decipher statement table of comparisons and statement interpretation module finally to show that at portable terminal the data message that obtains is than horn of plenty, almost can separate and translate the total data information that comprises in the Web Service service data that Web Service server returns, but to the handling property of portable terminal and having relatively high expectations of memory property; Employing is simple more by the scheme running of the XML interpreter decipher Web Service service data that decipher function reference table, Web Service service data indicating template and decipher functional value extraction module constitute, execution efficient height, requirement to portable terminal handling property and memory property is also relatively low, but portable terminal shows that the data message that obtains is comparatively single, is applicable to the value-added service of customization.In using, concrete value-added service can select suitable XML interpreter according to the needs of actual conditions.
5, can also set up communication network joint detection function in the inventive method, avoid connecting the seemingly-dead situation of portable terminal that causes because of waiting as long for communication network.
Description of drawings
Fig. 1 is the FB(flow block) of the inventive method;
Fig. 2 is the FB(flow block) of the inventive method improvement project.
Embodiment
Because there is the difference of system platform unavoidably in the used portable terminal of user, it is too high directly to develop the functional software cost that calls Web Service interface on system platform.If can be used in the function that third party's platform that most system platforms can both generally support comes complete call Web Service interface, just can avoid the problem of system platform difference.The J2ME platform can move on all are equipped with the portable terminal of JAVA virtual machine, Android, Windows Mobile, symbian, system platforms such as Linux, BlackBerry are all supported the JAVA virtual machine simultaneously, and at present on the market portable terminal generally all is equipped with the JAVA virtual machine, so J2ME can be described as at present the third party's platform the most widely of portable terminal support on the market., the communication protocol of J2ME platform and Web Service communication protocol are also incompatible, so the J2ME platform can not directly be realized the call operation to Web Service interface; This incompatible two aspects that are mainly reflected in: 1. the type function of the data type of J2ME platform configuration and soap protocol encapsulation not exclusively mates, so the J2ME platform can't directly send the interface interchange request of soap protocol to Web Service server; 2. the XML form Web Service service data that issues of Web Service server and the analytical function of J2ME platform configuration are not complementary, so the J2ME platform can not directly be finished the demonstration that Web Service server is issued the documents and handles.
For this reason, the present invention proposes a kind of method of calling Web Service interface based on J2ME, common programming technique personnel are by the inventive method making software on the J2ME platform, realize calling by moving this software to Web Service interface at the J2ME platform, make the portable terminal that the JAVA virtual machine is installed can both realize Web Service interface interchange function, thus allow user's portable terminal can be general pass through to call Web Service interface developing value-added services; And the present invention program only needs to develop at the J2ME platform, can move on all support the portable terminal of JAVA virtual machine, need not to carry out overlapping development at the different mobile terminal system platform, has fallen the value-added service development cost greatly.
Below in conjunction with drawings and Examples technical scheme of the present invention is further described.
Embodiment 1:
Present embodiment need be implemented in portable terminal and call Web Service interface and obtain the weather data in Chongqing, the interface IP address that calls Web Service interface is " http://www.feinno.com/weatherservice/ ", and call parameters is for needing the city title " Chongqing " of inquiry weather data.
Adopt the inventive method calls Web Service interface on the J2ME platform method flow as shown in Figure 1, concrete steps are as follows: at J2ME platform construction XML compiler and XML interpreter; Call the interface IP address and the call parameters of Web Service interface in advance in the setting of J2ME platform, the XML compiler then generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters; The J2ME platform sends the request of described Web Service interface interchange by communication network to Web Service server then, after wait gets access to the Web Service service data of the XML form that Web Service server returns, by the XML interpreter described Web Service service data is interpreted as the J2ME file, shows processing by the J2ME platform.
Present embodiment is when concrete the processing, and constructed XML compiler mainly is made of compiling function reference table and call request generation module.
Compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function.In the present embodiment, compiling function reference table is as shown in table 1:
Table 1
Figure 2011101820396100002DEST_PATH_IMAGE001
In the table 1, " scanWSurl " and " scanWSpar " is respectively interface IP address input record function and call parameters input record function in the J2ME platform, and " * * * " represents asterisk wildcard.
One the Web Service interface interchange request constructor of call request generation module for realizing by programming, its function is the Web Service interface interchange request that generates the XML form according to the soap protocol structure, and in construction process, by query compiler function reference table, the value of getting XML interface IP address function " getWeatherbyCityName xmlns " in the request of Web Service interface interchange is the interface IP address that calls Web Service interface (i.e. " scanWSurl " corresponding value) of J2ME platform input, gets the call parameters of calling Web Service interface (i.e. value of " scanWSpar " correspondence) of the value of XML call parameters function in the request of Web Service interface interchange "<theCityName〉" for the input of J2ME platform; The core partial code is as follows in the Web Service interface interchange request that structure generates:
“<?xml?version="1.0"?encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getWeatherbyCityName?xmlns="http://www.feinno.com/weatherservice/">
<theCityName〉Chongqing</theCityName 〉
</getWeatherbyCityName>
</soap:Body>
</soap:Envelope>”;
Soap protocol is a well-known protocol, therefore the Web Service interface interchange request according to soap protocol structure generation XML form can realize different programming technique personnel, just this XML interpreter scheme requires portable terminal to have the high processing performance, can finish the structure processing procedure of Web Service interface interchange request fast, simultaneously also need portable terminal to have higher memory property, can store and generate the necessary soap protocol content of Web Service interface interchange request; But structure generates the concrete programming of Web Service interface interchange request can be very flexible, and help the later stage to this function expansion.
After generating the request of Web Service interface interchange, the J2ME platform sends the request of described Web Service interface interchange by communication network to Web Service server, the Web Service service data of the XML form that Web Service server returns is obtained in wait, comprise the Weather information in Chongqing in the Web Service service data that gets access to, resolve by the XML compiler.
Constructed XML interpreter mainly is made of the decipher statement table of comparisons and statement interpretation module.
The decipher statement table of comparisons records the contrast relationship of XML structured statement and J2ME structured statement, promptly is equivalent to the structured statement contrasting data storehouse of XML and J2ME; The statement interpretation module is by the inquiry decipher statement table of comparisons, and the XML structured statement that constitutes the Web Service service data that Web Service server returns is interpreted as the J2ME structured statement, obtains the J2ME file of Web Service service data.At present embodiment, as follows in the Web Service service data that Web Service server returns about the XML structured statement of Chongqing Weather information:
"<CityName〉Chongqing</CityName 〉
<CityPic>57516.jpg</CityPic>
<Time>2011-6-27?16:41:04</Time?>
<Temp>24℃/31℃</Temp>
<Weath〉June 27 is overcast to cloudy</Weath 〉
<Wind〉no sustained wind to gentle breeze</Wind
<WeathPic>2.gif</WeathPic>
<WindPic>1.gif</WindPic>”;
Decipher is handled in the Web Service service data J2ME file that obtains as follows about the J2ME structured statement of Chongqing Weather information through the statement interpretation module:
" getCityName=" Chongqing "
getCityPic=“57516.jpg”
getTime=“2011-6-27?16:41:04”
getTemp=“24℃/31℃”
GetWeath=" June 27 is overcast to cloudy "
GetWind=" no sustained wind is to gentle breeze "
getWeathPic=“2.gif”
getWindPic=“1.gif””;
The J2ME file just can directly be read by the J2ME platform and show processing, demonstrates the above-mentioned weather condition in Chongqing on portable terminal; Wherein, " 57516.jpg ", " 2.gif ", " 1.gif " are respectively regional picture file, weather dynamic picture file and the wind-force dynamic picture file that is comprised in the Web Service service data.
This XML interpreter scheme also requires portable terminal to have the high processing performance, can fast processing finish the decipher process, simultaneously also need portable terminal to have higher memory property, can store the structured statement contrasting data storehouse of bigger XML of data volume and J2ME; But this XML interpreter scheme shows the data message obtain than horn of plenty at portable terminal, almost can separate the total data information that comprises in the Web Service service data that Web Service server returns that translates.
Embodiment 2:
Present embodiment is another embodiment of obtaining the weather data in Chongqing among the embodiment 1, and the method and the embodiment that call Web Service interface on its J2ME platform are basic identical, is that constructed XML compiler and XML interpreter is different.
XML compiler constructed in the present embodiment mainly please be sought template and compile the functional value extraction module and be constituted by compiling function reference table, Web Service interface interchange;
Compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function; Compiling function reference table concrete structure is also identical with table 1.
The Web Service interface interchange request XML file template that Web Service interface interchange please seek template and be based on soap protocol; This XML file template needs to edit in advance to finish and be stored in portable terminal, waits in generating Web Service interface interchange request process being called.
Compiling functional value extraction module then extracts caller for of realizing by programming, its function is to extract Web Service interface interchange please seek template, and query compiler function reference table, the value of XML interface IP address function during the interface IP address that calls Web Service interface of extraction J2ME platform input (i.e. " scanWSurl " corresponding value in the table 1) please seek template as Web Service interface interchange, the value of XML call parameters function generated the Web Service interface interchange request of XML form thus during the call parameters of calling Web Service interface of extraction J2ME platform input (i.e. " scanWSpar " corresponding value in the table 1) please seek template as Web Service interface interchange.
This XML compiler scheme is called mode that Web Service interface interchange please seek template by extraction and has been avoided Web Service interface interchange request to construct processing, therefore running is simple more, execution efficient is also higher, and is relatively low to the portable terminal handling performance requirements; On storage, also need not storage and generate the necessary soap protocol content of Web Service interface interchange request, and only need store the less relatively compiling function reference table of data volume and Web Service interface interchange please seek template, therefore also relatively low to the mobile terminal stores performance demands; But because Web Service interface interchange please seek template and to be determined by pre-edit and can't change, therefore the application flexibility of this XML compiler scheme is relatively poor, can only be used for the Web Service server of appointment is carried out Web Service interface interchange, be applicable to the value-added service of customization.
After generating the request of Web Service interface interchange, the J2ME platform sends the request of described Web Service interface interchange by communication network to Web Service server, the Web Service service data of the XML form that Web Service server returns is obtained in wait, comprise the Weather information in Chongqing in the Web Service service data that gets access to, resolve by the XML compiler.
The constructed XML interpreter of present embodiment mainly is made of decipher function reference table, Web Service service data indicating template and decipher functional value extraction module;
Decipher function reference table record has XML to call result function and J2ME calls the corresponding relation of explicit function as a result; Wherein, XML calls the function that Web Service interface gained service result is called in expression in the Web Service service data that result function is meant that Web Service server returns; J2ME calls as a result, and explicit function is meant that the expression display object is to call the function of Web Service interface gained service result in the Web Service service data indicating template.At present embodiment, decipher function reference table is as shown in table 2:
Table 2
Only write down temperature, weather in the decipher function reference table, three XML of wind direction call result function and J2ME calls the corresponding relation of explicit function as a result, show only to comprise temperature, weather, three functions that show service result of wind direction in the Web Service service data indicating template, " * * * " represents asterisk wildcard.
Web Service service data indicating template is the J2ME file template of the contained information of Web Service service data that is used for showing that Web Service server returns; This J2ME file template also needs to edit in advance finishes and is stored in portable terminal, waits for being called in the decipher processing procedure.
Decipher functional value extraction module extracts caller for of realizing by programming, its function is for extracting Web Service service data indicating template, and inquiry decipher function reference table, extract the value that XML in the Web Service service data that Web Service server returns calls result function and call the value of explicit function as a result as J2ME in the Web Service service data indicating template.
At present embodiment, as follows in the Web Service service data that Web Service server returns about the XML structured statement of Chongqing Weather information:
"<CityName〉Chongqing</CityName 〉
<CityPic>57516.jpg</CityPic>
<Time>2011-6-27?16:41:04</Time?>
<Temp>24℃/31℃</Temp>
<Weath〉June 27 is overcast to cloudy</Weath 〉
<Wind〉no sustained wind to gentle breeze</Wind
<WeathPic>2.gif</WeathPic>
<WindPic>1.gif</WindPic>”;
Owing to only comprise temperature, weather, three functions that show service result of wind direction in the Web Service service data indicating template, therefore decipher functional value extraction module also only extracts the value that temperature, weather, three XML of wind direction are called result function from the Web Service service data that Web Service server returns, and obtains in the Web Service service data indicating template J2ME and calls as a result that the value of explicit function is:
“getTemp=“24℃/31℃”
GetWeath=" June 27 is overcast to cloudy "
GetWind=" no sustained wind is to gentle breeze " ";
Thereby obtain including the J2ME file that calls Web Service interface gained service result.The J2ME platform reads this J2ME file and shows processing, demonstrates the weather condition in Chongqing on just can portable terminal.
Adopt this XML interpreter scheme, the decipher that the mode of calling Web Service service data indicating template by extraction has avoided the XML structured statement to Web Service service data to carry out is sentence by sentence handled, call as a result as J2ME in the Web Service service data indicating template that the value of explicit function gets final product and only need extract value that XML in the Web Service service data calls result function, therefore running is simple more, execution efficient is higher, and is lower to the portable terminal handling performance requirements; And also need not to store the structured statement contrasting data storehouse of bigger XML of data volume and J2ME, lower to the mobile terminal stores performance demands; Can't to change the data message that makes portable terminal show to obtain to Web Service service data indicating template comparatively single but because of portable terminal, but also can reach the purpose that filters out unwanted redundant data like this, simultaneously can also in Web Service service data indicating template, define some advertisement display statements etc., so this XML interpreter scheme also is the value-added service that is applicable to customization.
As further improvement project, can also be after the interface IP address and call parameters of Web Service interface be called in the setting of J2ME platform, the J2ME platform also detects communication network connection situation, judges whether connect communication network surpasses preset time T 0 nothing response; If then the prompting networking is overtime; If not, carry out the XML compiler generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters step again; Its flow process as shown in Figure 2.Carrying out communicating the network joint detection earlier before the Web Service interface interchange like this, can avoid under the obstructed situation of network, calling Web Service interface, causing waiting as long for the communication network connection processing, causing the seemingly-dead situation of portable terminal.And the realization of this improvement project is not subjected to any influence of XML compiler and XML interpreter, is applicable to all XML compilers and XML interpreter scheme.
Explanation is at last, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not breaking away from the aim and the scope of technical solution of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (6)

1. call the method for Web Service interface based on J2ME, it is characterized in that, at J2ME platform construction XML compiler and XML interpreter;
Call the interface IP address and the call parameters of Web Service interface in advance in the setting of J2ME platform, the XML compiler then generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters;
The J2ME platform sends the request of described Web Service interface interchange by communication network to Web Service server then, after wait gets access to the Web Service service data of the XML form that Web Service server returns, by the XML interpreter described Web Service service data is interpreted as the J2ME file, shows processing by the J2ME platform.
2. the method for calling Web Service interface based on J2ME according to claim 1 is characterized in that described XML compiler mainly is made of compiling function reference table and call request generation module;
Described compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function;
Described call request generation module generates the Web Service interface interchange request of XML form according to the soap protocol structure, in the construction process, by query compiler function reference table, get the interface IP address that call Web Service interface of the value of XML interface IP address function in the request of Web Service interface interchange, get the call parameters of calling Web Service interface of the value of XML call parameters function in the request of Web Service interface interchange for the input of J2ME platform for the input of J2ME platform.
3. the method for calling Web Service interface based on J2ME according to claim 1 is characterized in that described XML compiler mainly please be sought template and compile the functional value extraction module and be constituted by compiling function reference table, Web Service interface interchange;
Described compiling function reference table record has the interface IP address that calls Web Service interface of J2ME platform input and the corresponding relation of XML interface IP address function, and the call parameters of calling Web Service interface of J2ME platform input and the corresponding relation of XML call parameters function;
The Web Service interface interchange request XML file template that described Web Service interface interchange please seek template and be based on soap protocol;
Described compiling functional value extraction module extracts Web Service interface interchange and please seek template, and query compiler function reference table, the value of XML interface IP address function during the interface IP address that calls Web Service interface of extraction J2ME platform input please seek template as Web Service interface interchange, the value of XML call parameters function generated the Web Service interface interchange request of XML form during the call parameters of calling Web Service interface of extraction J2ME platform input please seek template as Web Service interface interchange.
4. the method for calling Web Service interface based on J2ME according to claim 1 is characterized in that described XML interpreter mainly is made of the decipher statement table of comparisons and statement interpretation module;
The described decipher statement table of comparisons records the contrast relationship of XML structured statement and J2ME structured statement;
Described statement interpretation module is by the inquiry decipher statement table of comparisons, and the XML structured statement that constitutes the Web Service service data that Web Service server returns is interpreted as the J2ME structured statement, obtains the J2ME file of Web Service service data.
5. the method for calling Web Service interface based on J2ME according to claim 1 is characterized in that described XML interpreter mainly is made of decipher function reference table, Web Service service data indicating template and decipher functional value extraction module;
Described decipher function reference table record has XML to call result function and J2ME calls the corresponding relation of explicit function as a result; It is the function that Web Service interface gained service result is called in expression in the Web Service service data returned of Web Service server that described XML calls result function; J2ME calls as a result, and explicit function is that the expression display object is to call the function of Web Service interface gained service result in the Web Service service data indicating template;
Described Web Service service data indicating template is the J2ME file template of the contained information of Web Service service data that is used for showing that Web Service server returns;
Described decipher functional value extraction module extracts Web Service service data indicating template, and inquiry decipher function reference table, extract the value that XML in the Web Service service data that Web Service server returns calls result function and call the value of explicit function as a result, obtain including the J2ME file that calls Web Service interface gained service result as J2ME in the Web Service service data indicating template.
6. according to each described method of calling Web Service interface based on J2ME in the claim 1 ~ 5, it is characterized in that, call the interface IP address and call parameters of Web Service interface in the setting of J2ME platform after, the J2ME platform also detects communication network connection situation, judges whether connect communication network surpasses preset time T 0 nothing response; If then the prompting networking is overtime; If not, carry out the XML compiler generates the Web Service interface interchange request of XML form according to set interface IP address and call parameters step again.
CN2011101820396A 2011-06-30 2011-06-30 Java 2 micro edition (J2ME)-based Web Service interface calling method Active CN102255961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011101820396A CN102255961B (en) 2011-06-30 2011-06-30 Java 2 micro edition (J2ME)-based Web Service interface calling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011101820396A CN102255961B (en) 2011-06-30 2011-06-30 Java 2 micro edition (J2ME)-based Web Service interface calling method

Publications (2)

Publication Number Publication Date
CN102255961A true CN102255961A (en) 2011-11-23
CN102255961B CN102255961B (en) 2013-11-13

Family

ID=44982951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011101820396A Active CN102255961B (en) 2011-06-30 2011-06-30 Java 2 micro edition (J2ME)-based Web Service interface calling method

Country Status (1)

Country Link
CN (1) CN102255961B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530401A (en) * 2013-10-23 2014-01-22 山东大学 Method for obtaining data and drawing graph based on web service
CN103927193A (en) * 2013-01-15 2014-07-16 中兴通讯股份有限公司 Loading method and server side virtual machine used in migration running of Java application program functions
CN104166551A (en) * 2014-08-14 2014-11-26 华为技术有限公司 Application interface developing method and developing device
CN108255905A (en) * 2017-05-04 2018-07-06 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
CN108683550A (en) * 2018-07-11 2018-10-19 武汉斗鱼网络科技有限公司 A kind of call method and relevant device of configuration interface

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101400109A (en) * 2007-09-30 2009-04-01 华为技术有限公司 General service opening interface system and general service opening method
US7917629B2 (en) * 2004-12-29 2011-03-29 Sap Ag Interface for external system management

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917629B2 (en) * 2004-12-29 2011-03-29 Sap Ag Interface for external system management
CN101400109A (en) * 2007-09-30 2009-04-01 华为技术有限公司 General service opening interface system and general service opening method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨彩: "基于Web Services的移动彩票***", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927193A (en) * 2013-01-15 2014-07-16 中兴通讯股份有限公司 Loading method and server side virtual machine used in migration running of Java application program functions
CN103927193B (en) * 2013-01-15 2017-10-17 中兴通讯股份有限公司 Loading method, service end virtual machine during the migration operation of java application function
CN103530401A (en) * 2013-10-23 2014-01-22 山东大学 Method for obtaining data and drawing graph based on web service
CN104166551A (en) * 2014-08-14 2014-11-26 华为技术有限公司 Application interface developing method and developing device
CN108255905A (en) * 2017-05-04 2018-07-06 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
WO2018201978A1 (en) * 2017-05-04 2018-11-08 平安科技(深圳)有限公司 Interface call data processing method, apparatus, computer device and storage medium
CN108255905B (en) * 2017-05-04 2019-10-01 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
CN108683550A (en) * 2018-07-11 2018-10-19 武汉斗鱼网络科技有限公司 A kind of call method and relevant device of configuration interface

Also Published As

Publication number Publication date
CN102255961B (en) 2013-11-13

Similar Documents

Publication Publication Date Title
US7546298B2 (en) Software, devices and methods facilitating execution of server-side applications at mobile devices
US7865528B2 (en) Software, devices and methods facilitating execution of server-side applications at mobile devices
CN101695032B (en) Unified web client, service configuration method and system thereof
CN102057654B (en) Mobile device application framework
CN101847100B (en) Method for expanding software application and device
CN102255961B (en) Java 2 micro edition (J2ME)-based Web Service interface calling method
JP5122467B2 (en) Multimedia middleware apparatus using metadata, control method thereof and storage medium
CN101553812A (en) Dynamic device profile interfaces
CN110764752B (en) System and method for realizing graphic service arrangement of Restful service
CN103577568A (en) Cross-platform mobile safety comprehensive information aggregation system and method adopting same
CN101990169A (en) Intelligent card active pushing system and intelligent card mobile terminal
CN101425012A (en) Method and device for generating case script based on model automatization
CN103473034A (en) Method and device for dynamically publishing Web service
CN102111160B (en) Coding and decoding system and codec for reactive system test
KR100876958B1 (en) A Middleware for Data Communication Between Various Terminals and Application Server and An Operating Method thereof
CN102546737B (en) Wireless Internet gateway access system and method
CN101321178A (en) Portal workflow engine system and its implementing method
CN102158542A (en) CBAE platform
CN100386757C (en) Mobile communication terminal, system and method for personal data managemnt
CN103257855A (en) MVC (model view controller) based processing system, MVC based processing method and application in facial beautifying software
CN102508665B (en) Method for drawing application view and device for drawing application view
CN102821116B (en) A kind of online service provides method, device and information system
CN102137079A (en) Method and device for developing service for RPC (Remote Procedure Call)
KR100837142B1 (en) Device and method of providing network contents for heterogeneous mobile platforms and computer-readable medium having thereon program performing function embodying the same
AU2003271847B2 (en) Wireless communication device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200605

Address after: Room 502-1, floor 5, building 2, courtyard 10, KEGU 1st Street, Beijing Economic Development Zone, Daxing District, Beijing 100081

Patentee after: Singularity Xinyuan International Technology Development (Beijing) Co.,Ltd.

Address before: The 401121 northern New District of Chongqing municipality Mount Huangshan Road 5 south of Mercury Technology Building 1 floor office No. 3

Patentee before: A-MEDIA COMMUNICATION TECH Co.,Ltd.