CN103647795B - The adjustment method that a kind of widget of realization remote service is called - Google Patents

The adjustment method that a kind of widget of realization remote service is called Download PDF

Info

Publication number
CN103647795B
CN103647795B CN201310474359.8A CN201310474359A CN103647795B CN 103647795 B CN103647795 B CN 103647795B CN 201310474359 A CN201310474359 A CN 201310474359A CN 103647795 B CN103647795 B CN 103647795B
Authority
CN
China
Prior art keywords
service
debugging
debugging server
data
request
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.)
Active
Application number
CN201310474359.8A
Other languages
Chinese (zh)
Other versions
CN103647795A (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.)
Zhejiang Success Software Development Co., Ltd.
Original Assignee
Zhejiang University City College ZUCC
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 Zhejiang University City College ZUCC filed Critical Zhejiang University City College ZUCC
Priority to CN201310474359.8A priority Critical patent/CN103647795B/en
Publication of CN103647795A publication Critical patent/CN103647795A/en
Application granted granted Critical
Publication of CN103647795B publication Critical patent/CN103647795B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to the adjustment method that a kind of widget of realization remote service is called, comprise the following steps: in IDE, start a debugging server;Debugging server supports service by reading in debugging services definition file build debugging;Widget application program connects debugging server and sends service request;Debugging server is by the service definition file process service request having been read into;The debugging server all data by the whole request process of log recording.A remote service debugging server is realized by Plugin Mechanism in Eclipse, and this debugging server uses what the service definition file of collocation type carried out servicing to intercept, request processes and service data return, the debugging efforts that widget developer can be made remote service to be called also is built in IDE, not only save the development time, and the exploitation of remote service need not be learnt again and realize technology, reduce the exploitation barrier of widget.

Description

A kind of realization widget The adjustment method that remote service is called
Technical field
The present invention relates to software program debugging technique, particularly relate to a kind of method how debugging remote service is called in IDE.
Background technology
Widget Chinese is " widget ", refer under internet environment, the application program that can run in the special container of computer or mobile device, widget has the form specific to container and packing specification, but it is characterized in being prone to dispose on the internet, and can obtain data from local or the Internet, its main purpose is to facilitate user to obtain and access service.In real world applications, widget can access remote service, to obtain service data.At present at widget development field, according to the demand of technical standard of different widget, there is different development environments, in Widget exploitation, the most widely used IDE is Eclipse.
Eclipse is the plug-in type IDE of a kind of open source code, is one of foremost open source projects.
Eclipse uses OSGi to design pattern, pass through Plugin Mechanism, realize the Function Extension of plug type, the plug set of the subsidiary standard of Eclipse release version, support Java language is developed, by download plug-in, the development support environment of javascript, html and css required for widget exploitation can be constructed very easily.Current Eclipse develops widget, by the plug-in unit downloaded, widget application code is write support etc. the most perfect, but need in developing due to widget to access remote service, how to construct remote service for supporting that widget exploitation also lacks unified method at present, need developer to select voluntarily to realize technological development support, there is the biggest inconvenience.
Summary of the invention
In view of debugging the problem that remote service exists in Eclipse, the technical problem to be solved is: provide the adjustment method that a kind of widget of realization remote service is called.
The technical method that the present invention solves the employing of its technical problem is as follows:
The adjustment method that a kind of widget of realization remote service is called, comprises the following steps:
A debugging server is started in IDE;
Debugging server supports service by reading in debugging services definition file build debugging;
Widget application program connects debugging server and sends service request;
Debugging server is by the service definition file process service request having been read into;
The debugging server all data by the whole request process of log recording.
Wherein, IDE is Eclipse environment.
Wherein, IDE starts a debugging server to include:
Installation and debugging server controls plug-in unit in IDE;
By clicking on the Start-up and Adjustment Servers button of server controls plug-in unit, Start-up and Adjustment server.
Wherein, debugging server supports service by reading in debugging services definition file build debugging, comprises the following steps:
Service definition file is read by the path specified;
Analysis service definition file;
Service URI is constructed by the service position defined in service document;
Start to intercept request on service URI.
Wherein, widget application program connection debugging server is sent to service and asks to be completed by http protocol.
Wherein, debugging server, by the service definition file process service request having been read into, comprises the following steps:
Checking request data is the most consistent with required by service definition file;
According to service definition file generated and return service result.
Wherein, the debugging server all data by the whole request process of log recording, comprise the following steps:
Record the data of all service requests;
Record the result of all service requests;
Record all service result data being generated and returned to widget application program;
Record the abnormal information failing in all processing procedures to expect.
Wherein, the debugging server all data by the whole request process of log recording, the method for data record includes:
Recorded in text;
Recorded in relevant database;
Recorded in the output control station of IDE.
Wherein, installation and debugging server controls plug-in unit in IDE, this control plug-in unit includes following control knob:
Start-up and Adjustment Servers button;
Close debugging server button;
Open debugging server parameter configuration interface button.
Wherein, the file for Xml form of service definition file, the definition content of service definition file includes:
Service URI;
The form of request data;
The result data that service returns.
Wherein, the result data that service returns is not single, can return service result data according to strategy, and available strategy includes:
Unique service result data;
Service result data according to request data structure;
Random service result data.
The present invention starts a debugging server by built-in plug-in unit in Eclipse IDE.Debugging server start-up course is read in service definition file, the service definition document analysis after reading in afterwards.
Further, by analysis service definition file acquisition service URI, start to make requests on the position of URI definition to intercept.
Further, the widget application program in exploitation sends service request, and this request is sent by http agreement.
Further, after debugging server obtains service request, starting to verify according to description to request data in service definition file, the integrity of checking request data, the correctness of form and data type are the most consistent with service definition file.
Further, according to the service result data defined in service definition file, constructing service result data, the strategy of structure service result data includes: unique service result data;Service result data according to request data structure;Random service result data.
According to the log recording method of the present invention, the daily record data at record is needed to include: to record the data of all service requests;Record the result of all service requests;Record all service result data being generated and returned to widget application program;Record the abnormal information failing in all processing procedures to expect.
According to the log recording method of the present invention, the recording means of daily record data includes: recorded in text;Recorded in relevant database;Recorded in the output control station of IDE.
Compared with existing adjustment method, by realizing a remote service debugging server by Plugin Mechanism in Eclipse, and this debugging server uses what the service definition file of collocation type carried out servicing to intercept, request processes and service data return, the debugging efforts that widget developer can be made remote service to be called also is built in IDE, not only save the development time, and the exploitation of remote service need not be learnt again and realize technology, reduce the exploitation barrier of widget.
Accompanying drawing explanation
Fig. 1 is the work process schematic diagram of the adjustment method that widget remote service is called.
Fig. 2 is the various key elements related in the adjustment method work process that widget remote service is called.
Fig. 3 is the structure chart of service definition file in the adjustment method that widget remote service is called.
Detailed description of the invention
Below by specific embodiments and the drawings, the present invention is described in further details.
The core concept of the present invention is by a debugging server integrated in IDE, make widget exploitation carries out can individually writing when remote service is called the remote service of debugging, but the service needed by service definition file configuration, support the development of widget.Below in an example, Eclipse IDE is used.
The invention mainly comprises following components:
A debugging server is started in IDE;
Debugging server supports service by reading in debugging services definition file build debugging;
Widget application program connects debugging server and sends service request;
Debugging server is by the service definition file process service request having been read into;
The debugging server all data by the whole request process of log recording.
Wherein, IDE starts a debugging server to include:
Installation and debugging server controls plug-in unit in IDE;
By clicking on the Start-up and Adjustment Servers button of server controls plug-in unit, Start-up and Adjustment server.
Wherein, debugging server supports service by reading in debugging services definition file build debugging, comprises the following steps:
Service definition file is read by the path specified;
Analysis service definition file;
Service URI is constructed by the service position defined in service document;
Start to intercept request on service URI.
Wherein, widget application program connection debugging server is sent to service and asks to be completed by http protocol.
Wherein, debugging server, by the service definition file process service request having been read into, comprises the following steps:
Checking request data is the most consistent with required by service definition file;
According to service definition file generated and return service result.
Wherein, the debugging server all data by the whole request process of log recording, comprise the following steps:
Record the data of all service requests;
Record the result of all service requests;
Record all service result data being generated and returned to widget application program;
Record the abnormal information failing in all processing procedures to expect.
Wherein, the debugging server all data by the whole request process of log recording, the method for data record includes:
Recorded in text;
Recorded in relevant database;
Recorded in the output control station of IDE.
Wherein, installation and debugging server controls plug-in unit in IDE, this control plug-in unit includes following control knob:
Start-up and Adjustment Servers button;
Close debugging server button;
Open debugging server parameter configuration interface button.
Wherein, the file for Xml form of service definition file, the definition content of service definition file includes:
Service URI;
The form of request data;
The result data that service returns.
Wherein, the result data that service returns is not single, can return service result data according to strategy, and available strategy includes:
Unique service result data;
Service result data according to request data structure;
Random service result data.
Embodiment:
Fig. 1 is the work process schematic diagram of the adjustment method that widget remote service is called, and sees Fig. 1, and this process includes:
Step 101, a debugging server is started in IDE, first installation and debugging server controls plug-in unit in IDE Eclipse, this plug-in unit is write by the extension point of Eclipse, after plug-in unit is installed successfully, starts Eclipse, there will be three buttons at toolbar, it is Start-up and Adjustment Servers button respectively, closes debugging server button, open debugging server parameter configuration interface button.The relation of plug-in unit and Eclipse and debugging server thereof is as shown in Figure 2.
Step 102, clicks on Start-up and Adjustment Servers button, starts Start-up and Adjustment server.
Step 103, when debugging server starts, service definition file is read in the path by specifying, and defined in the debugging server parameter configuration interface that service definition document location is provided by plug-in unit, in the present embodiment, the configurable parameter of debugging server includes:
Debugging server, by the service definition document location configured, navigates to service definition file, reads in service definition file, starts analysis service definition file.
As schematically shown in Figure 3, service definition file uses the definition of xml form to the structure of service definition file, can define multiple service in a service definition file, and in the present embodiment, service definition file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<services>
<service name="testService">
<uri>http://127.0.0.1:8080/service/broadcast</uri>
<request>
<field name="city" type="string"/>
<field name="date" type="datetime"/>
</request>
<response>
<field name="today" type="string" value="cloudy"/>
<field name="todayplus1" type="string" value="cloudy"/>
<field name="todayplus2" type="string" value="rain"/>
<field name="todayplus3" type="string" value="sun"/>
</response>
</service>
</services>
Step 104, after debugging server reads in above-mentioned service definition file, will begin listening on the position defined in uri label, and the position of intercepting defined in the present embodiment is: http: // 127.0.0.1:8080/service/broadcast.
Step 105, widget application program in exploitation is to http: when // 127.0.0.1:8080/service/broadcast initiates request, debugging server will receive service request, service request is that widget application program is sent by http agreement, the key data form that debugging server support remote service is called: xml data form and json data form, in the present embodiment, the widget in exploitation initiates the request of json data form to debugging server, and the data of request are as follows:
{“city”:”Hangzhou”, “date”:”2013-09-22”}
Now the above-mentioned request data received be recorded in daily record by journal function, and the position of daily record is configured project by above-mentioned log recording mode and determines, debugging server installation log recording mode defines, write target location data do not made an amendment.
Step 106, debugging server starts after receiving above-mentioned request data to verify request, according to the above-mentioned service definition file in embodiment, needs to verify whether the city field in request data is character string, and whether checking date field is legal date value;In the present embodiment, above-mentioned checking is the most correctly passed through, and now the result be recorded in daily record by debugging server, and recording mode is determined by the log recording mode project configured.
Step 107, debugging server defines return service result data, the response label segment in service definition file described in the present embodiment according to the service result data in service definition file after verifying.Service result data use and ask identical data form to return, if request is json data form, then use json data form, if request uses xml data form, then use xml data form;According to the definition in service definition file in the present embodiment, the service result data that use json form return is following:
{
" today ": " cloudy ",
“todayplus1 ": " cloudy ",
“todayplus2 ": " rain ",
“todayplus3 ": " sun "
}
Now the service result data of return be recorded in daily record by debugging server, and recording mode is determined by the log recording mode project configured.
The debugging support that remote service is called is mainly usage log record, and the log recording way of output is divided into three kinds, respectively: output to file, and output to data base and output are to control station.
In the present embodiment, if output is to file, assume configuration log parameters be: c: widget debug log, so can input a journal file in the catalogue that this parameter defines, journal file title is automatically generated by debugging server, it is assumed that for: log20130922.log, above-mentioned steps 105 can be exported in this journal file, step 106, the log recording in step 107, the log recording of the present embodiment is:
[2013-09-22 12:00:01,098]request service, uri: http://127.0.0.1:8080/service/broadcast
[2013-09-22 12:00:02,012]request data:
{“city”:”Hangzhou”, “date”:”2013-09-22”}
[2013-09-22 12:00:02,048]request data validate:OK
[2013-09-22 12:00:02,088]response data:
{
" today ": " cloudy ",
“todayplus1 ": " cloudy ",
“todayplus2 ": " rain ",
“todayplus3 ": " sun "
}
The log recording of different requests is appended to the end of journal file.
In the present embodiment, if output is to data base, it is assumed that the log parameters of configuration is: jdbc:mysql: //localhost:3306/sample_db?User=root&password=password, then debugging server can give tacit consent to one database table of establishment, comprises following field:
Foregoing is inserted in this log sheet by debugging server, and the data inserted in the present embodiment are:
In the present embodiment, if output is to the control station of IDE, then daily record data is directly output to the control station window of Eclipse, the content of input is consistent with the daily record data content in output to file.
The above; being only the present invention preferably detailed description of the invention, but protection scope of the present invention is not limited thereto, and any is familiar with the people of this technology in the technical scope that disclosed herein; the change that can readily occur in or replacement, all should contain within protection scope of the present invention.

Claims (10)

1. realize the adjustment method that widget remote service is called, comprise the following steps:
A debugging server is started in IDE;
Debugging server supports service by reading in debugging services definition file build debugging;
Widget application program connects debugging server and sends service request;
Debugging server is by the service definition file process service request having been read into;
The debugging server all data by the whole request process of log recording;
Wherein, debugging server supports service by reading in debugging services definition file build debugging, comprises the following steps:
Service definition file is read by the path specified;
Analysis service definition file;
Service URI is constructed by the service position defined in service document;
Start to intercept request on service URI.
Method the most according to claim 1, wherein, IDE is Eclipse environment.
Method the most according to claim 1, wherein, starts a debugging server in IDE and includes:
Installation and debugging server controls plug-in unit in IDE;By clicking on the start button of server controls plug-in unit, Start-up and Adjustment server.
Method the most according to claim 1, wherein, widget application program connects debugging server transmission service request to be completed by http protocol.
Method the most according to claim 1, wherein, debugging server, by the service definition file process service request having been read into, comprises the following steps:
Checking request data is the most consistent with required by service definition file;
According to service definition file generated and return service result.
Method the most according to claim 1, wherein, the debugging server all data by the whole request process of log recording, comprise the following steps:
Record the data of all service requests;
Record the result of all service requests;
Record all service result data being generated and returned to widget application program;
Record the abnormal information failing in all processing procedures to expect.
Method the most according to claim 1, wherein, the debugging server all data by the whole request process of log recording, the method for data record includes:
Recorded in text;
Recorded in relevant database;
Recorded in the output control station of IDE.
Method the most according to claim 3, wherein, installation and debugging server controls plug-in unit in IDE, this control plug-in unit includes following control knob:
Start-up and Adjustment Servers button;
Close debugging server button;
Open debugging server parameter configuration interface button.
9. according to the method described in claim 1 or claim 5, wherein, the file for Xml form of service definition file, the definition content of service definition file includes:
Service URI;
The form of request data;
The result data that service returns.
Method the most according to claim 9, wherein, the result data that service returns is not single, can return service result data according to strategy, and available strategy includes:
Unique service result data;
Service result data according to request data structure;
Random service result data.
CN201310474359.8A 2014-01-02 2014-01-02 The adjustment method that a kind of widget of realization remote service is called Active CN103647795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310474359.8A CN103647795B (en) 2014-01-02 2014-01-02 The adjustment method that a kind of widget of realization remote service is called

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310474359.8A CN103647795B (en) 2014-01-02 2014-01-02 The adjustment method that a kind of widget of realization remote service is called

Publications (2)

Publication Number Publication Date
CN103647795A CN103647795A (en) 2014-03-19
CN103647795B true CN103647795B (en) 2016-08-17

Family

ID=50252951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310474359.8A Active CN103647795B (en) 2014-01-02 2014-01-02 The adjustment method that a kind of widget of realization remote service is called

Country Status (1)

Country Link
CN (1) CN103647795B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589688B (en) * 2014-12-11 2019-04-09 中国银联股份有限公司 Application services dissemination method and device
CN106572128A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and device used for deploying applications in integrated development environment (IDE)
CN105739990B (en) * 2016-02-17 2018-11-02 浪潮通用软件有限公司 Implementation method for remote call of button based on C #
CN106815149B (en) * 2017-01-13 2020-05-22 上海市共进通信技术有限公司 Debugging system and method for software development based on intelligent gateway platform
CN109547430B (en) * 2018-11-16 2021-02-12 上海朔羡网络科技有限公司 Development service gateway system and development service gateway

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073507A (en) * 2009-11-20 2011-05-25 华为技术有限公司 Method, device and system for calling widget
CN102196010A (en) * 2010-03-12 2011-09-21 中兴通讯股份有限公司 System and method for implementing application open interface at terminal side
CN102902610A (en) * 2012-09-29 2013-01-30 四川长虹电器股份有限公司 Method for debugging Widget application program by simulator

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073507A (en) * 2009-11-20 2011-05-25 华为技术有限公司 Method, device and system for calling widget
CN102196010A (en) * 2010-03-12 2011-09-21 中兴通讯股份有限公司 System and method for implementing application open interface at terminal side
CN102902610A (en) * 2012-09-29 2013-01-30 四川长虹电器股份有限公司 Method for debugging Widget application program by simulator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向数字电视Widget集成开发环境的设计和实现;邬忠区;《中国优秀硕士学位论文全文数据库信息科技辑》;20111215;正文第1页、第16页至第61页 *

Also Published As

Publication number Publication date
CN103647795A (en) 2014-03-19

Similar Documents

Publication Publication Date Title
US10592319B2 (en) API notebook tool
CN103647795B (en) The adjustment method that a kind of widget of realization remote service is called
US9910651B2 (en) System for developing, testing, deploying, and managing applications in real-time
Kurniawan Learning AWS IoT: Effectively manage connected devices on the AWS cloud using services such as AWS Greengrass, AWS button, predictive analytics and machine learning
US9594802B2 (en) Graphical modeling of database query statements
US20150082298A1 (en) Packaging and deploying hybrid applications
US20090313256A1 (en) Reuse of shared metadata across applications via url protocol
CN111651224A (en) System and method for identifying, indexing and navigating to a depth state of a mobile application
US20160224530A1 (en) Mapping stored client data to requested data using metadata
CN102096582A (en) Off-line gadget integration development environment
CN104363578B (en) Mobile device connects the method and system that WIFI hot spot installs matching application automatically
Klauzinski et al. Mastering JavaScript Single Page Application Development
CN107391118B (en) Web application user experience platform system
Frederick et al. Beginning smartphone web development
Shaw et al. Web Development with Django: Learn to build modern web applications with a Python-based framework
WO2015165078A1 (en) Performing mirror test for localization testing
CN106126240A (en) A kind of method and system customizing mobile terminal desktop shortcut icon
CN109145209B (en) Method, apparatus and storage medium for searching blockchain data
Amarasinghe Service worker development cookbook
Nate The Little ASP. NET Core book
CN101441628A (en) Intelligent client terminal website system based on desktop application program
CN104539697B (en) A kind of client, server and the method for making Android mobile application
EP3001311A1 (en) Method for automatically converting web applications into application that can be installed automatically on a plurality of platforms
KR101820721B1 (en) Image forming device for serving a web service and method thereof
Orr et al. Programming with CodeIgniterMVC

Legal Events

Date Code Title Description
PB01 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: 20181107

Address after: 310000 room 2001-2004, block C, Kang Xin business building, 583 Wensanlu Road, Hangzhou, Zhejiang.

Patentee after: Zhejiang Success Software Development Co., Ltd.

Address before: 310015 Hangzhou City College, Zhejiang University, 51 Huzhou street, Gongshu District, Zhejiang.

Patentee before: Urban College of Zhejiang Univ.