Summary of the invention
In view of this, one object of the present invention is to provide a kind of method and system that receive input file, can not call the problem that telecommunication capability receives input file to solve the user.
In order to address the above problem, the invention provides a kind of method that receives input file, this method realizes based on presentation state-transition (REST) API (API) that the communication network territory provides, comprising:
Client is the resource of use with the input file that request receives, and sends to server and receives the input file request message, carries the resource unified resource position sign (URL) of said resource;
After said server is received said reception input file request message, obtain the information of said input file, return input file response message, the information of carrying said input file of receiving to said client.
Preferably
The information that comprises the action of use in the said reception input file request message; Said action is the obtaining of Hypertext Transfer Protocol(HTTP) (HTTP) (GET) action, and the resource URL of said resource comprises at least a in terminal participant's the indications of user's indications and file transfer session.
Preferably
The information of said input file comprises at least a in the following information: receive message session retransmission protocol (MSRP) path, send MSRP path, bytes range, successfully report, failure reporting, recipient user's indications, sender user's indications, file date, file content deployment, file content types and resource URL.
Preferably
Client is sent and is received before the input file request message, generates said reception input file request message by following mode:
The action that (GET) is use of obtaining with HTTP; The input file that receives with request is the resource of use; Generate message header, the resource URL of said resource comprises the terminal participant's who asks the reception input file the user's indications and/or the indications of the corresponding document transmission session that this terminal participant participates in;
Generate reception input file request message according to said message header.
Preferably
Said server receives the input file success, returns to receive before the input file response message, generates said reception input file response message by following mode:
Represent the responder of " success (OK) " to generate message header according to HTTP;
Generate the data structure of a file according to the information of said input file, as message body;
Generate reception input file response message according to said message header and message body.
Correspondingly, in the system of reception input file provided by the invention, client and server is mutual based on presentation state-transition (REST) API (API) that the communication network territory provides, and this system comprises:
Message creating apparatus in the client is used for generating reception input file request message;
Message dispensing device in the client is used for sending said reception input file request message to server;
Message sink in the server and processing unit are used to receive and resolve and handle after receiving the input file request message, obtain the information of said input file;
Message creating apparatus in the server is used for generating reception input file response message;
Message dispensing device in the server is used for returning said reception input file response message to said client.
Preferably
Message creating apparatus in the said client comprises again:
Message header generates sub-device; Be used for the action that (GET) is use of obtaining with HTTP; The input file that receives with request is the resource of use; Generate message header, the resource URL of said resource comprises the terminal participant's who asks the reception input file the user's indications and/or the indications of the corresponding document transmission session that this terminal participant participates in;
Message generates sub-device, is used for generating said reception input file request message according to said message header.
Message creating apparatus in the said server comprises again:
Message header generates sub-device, and the responder according to HTTP representes " success " generates message header;
Message body generates sub-device; Be used for according to the input file that receives reception message session retransmission protocol (MSRP) path, send at least a of MSRP path, bytes range, successfully report, failure reporting, recipient user's indications, sender user's indications, file date, file content deployment, file content types and resource URL; Generate the data structure of a file, as message body;
Message generates sub-device, is used for generating said reception input file response message according to said message header and message body.
Based on such scheme, users such as Web developer, third party developer or service provider can pass through client, use the REST API Access to call the telecommunication capability in telecom operators' network domains, server are received the relevant control of input file.
Another object of the present invention is to provide a kind of method and system of deleting input file, to solve the problem that the user can not call telecommunication capability deletion input file.
In order to address the above problem, the invention provides a kind of method of deleting input file, this method realizes based on presentation state-transition (REST) API (API) that the communication network territory provides, comprising:
Client is the resource of use with the input file of request deletion, sends deletion input file request message to server, carries the resource unified resource position sign (URL) of said resource;
Said server is deleted said input file after receiving said deletion input file request message, returns deletion input file response message to said client.
Preferably
Said deletion input file request message comprises the information of the action of use; Said action is deletion (Delete) action of Hypertext Transfer Protocol(HTTP) (HTTP), and the resource URL of said resource comprises at least a in terminal participant's the indications of user's indications and file transfer session.
Preferably
Said client is sent before the deletion input file request message, generates said deletion input file request message by following mode:
Input file with the request deletion is the resource of use; Deletion (Delete) action with HTTP is the action of use; Generate message header, the resource URL of said resource comprises the terminal participant's who asks the deletion input file the user's indications and/or the indications of the corresponding document transmission session that this terminal participant participates in;
Generate said deletion input file request message according to said message header;
The success of said server deletion input file is returned before the deletion input file response message, generates deletion input file response message by following mode:
The responder of representing " no content (No content) " according to HTTP generates message header;
Generate deletion input file response message according to said message header.
Correspondingly, in the system of deletion input file provided by the invention, client and server is mutual based on presentation state-transition (REST) API (API) that the communication network territory provides, and this system comprises:
Message creating apparatus in the client is used for generating deletion input file request message;
Message dispensing device in the client is used for sending said deletion input file request message to server;
Message sink in the server and processing unit are used for after receiving said deletion input file request message, resolving and handling, and delete said input file;
Message creating apparatus in the server is used for generating deletion input file response message;
Message dispensing device in the server is used for returning said deletion input file response message to said client.
Preferably
Message creating apparatus in the said client comprises again:
Message header generates sub-device; The input file that is used for the request deletion is the resource of use; Deletion (Delete) action with HTTP is the action of use; Generate message header, the resource URL of said resource comprises the terminal participant's who asks the deletion input file the user's indications and/or the indications of the corresponding document transmission session that this terminal participant participates in;
Message generates sub-device, is used for generating said deletion input file request message according to said message header;
Message creating apparatus in the said server comprises again:
Message header generates sub-device, is used for representing that according to HTTP the responder of " no content (No content) " generates message header;
Message generates sub-device, is used for generating said deletion input file response message according to said message header.
Based on such scheme, users such as Web developer, third party developer or service provider can pass through client, use the REST API Access to call the telecommunication capability in the communication network territory, server are deleted the relevant control of input file.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, hereinafter will combine accompanying drawing that embodiments of the invention are elaborated.Need to prove that under the situation of not conflicting, embodiment among the application and the characteristic among the embodiment be combination in any each other.
Embodiment one
Fig. 1 shows the system configuration of the professional telecommunication capability interface of the open file transfer of present embodiment.As shown in the figure; The communication network territory comprises IMS core net and operation layer; Operation layer comprises the miscellaneous service network equipments such as short message service server, MMS server, file transfer service server (like RCS file transfer service enabler) and other service servers; But the present invention is used for the professional server of file transfer also can be used for other multiple business simultaneously, is not limited to special-purpose server.These servers provide the REST that opens API to Web developer, third party developer, service provider etc.; User client such as Web developer, third party developer, service provider can be used REST API Access communication network territory; Call the RCS professional ability and the IMS network capabilities in communication network territory, realize the Web 2.0Widget lightweight application of telecommunication service and the exploitation of Mashup.
In the present embodiment, the application program of users such as Web developer, third party developer, service provider exploitation can be passed through client, and the REST API that uses present embodiment to provide receives the relevant control of input file to server.Client can be arranged in service provider's the network equipment, also can be arranged in end user device such as portable terminal, fixed terminal etc.The user that the present invention is suitable for also is not limited to the above-mentioned type, can be based on any file transfer participant that control authority is arranged of Internet service, WEB service.
The related definition of REST API uses in the present embodiment resource, action and data structure is following:
In the link of resource unified resource position sign, serverRoot representes server path, and apiVersion representes the API version; FileTransfer representes file transfer; Terminating representes the terminal, and TerminatingID representes terminal participant user's indications, and FileTransferSessions representes file transfer session; FileTransferSessionId representes the indications of file transfer session, and inbound representes input.
The type of data structure that above-mentioned REST API uses defines as follows:
Type of data structure Type:File file
Wherein, file content is disposed the expression suggestion and is received the processing mode of file side to this document content.Can comprise terminal participant's the user's indications and the indications of file transfer session among the resource URL of file.User's indications is as being station address.
Fig. 2 is the flow chart of present embodiment based on REST API reception input file, and this flow process may further comprise the steps:
Step S201: client is the resource of use with the input file that request receives, and sends to server and receives the input file request message, carries the resource unified resource position sign (URL) of said resource;
In the reception input file request message of present embodiment, comprise the action and the resource of use in the message header, can not carry message body.
Client can generate this message in the following manner:
The action that (GET) is use of obtaining with HTTP; The input file that receives with request is the resource of use; Generate message header, at least one in the indications of the corresponding document transmission session that user's indications that the resource URL of said resource comprises terminal participant (request receives the participant of input file) and this terminal participant participate in;
Generate reception input file request message according to said message header.
Below with a bright reception input file request message that once generates of as an exampleBSEMGVR takeN-PSVSEMOBJ.
Suppose that the terminal participant is user Peter E.Xample (SIP:user2example.com), the file transfer session indications is that { FileTransferSessionId1}, this user receives input file.
Below for receiving the example and the explanation of input file request message content:
GET
Http: // serverRoot}/apiVersion}/FileTransfer/Terminating/SIP:user2example.co m/FileTransferSessions/{FileTransferSessionId1}/inbound/ file HTTP/1.1 action+resource URL
Accept:application/xml
Host:example.com:80
In the example of some message contents that the application provides; Action, resource, data structure and partial information to defining among the REST API are described; The information that defines in other guide such as the data structure, the other guide in the message header etc. are please with reference to the regulation among preceding text and the Web.
Step S202: after said server is received said reception input file request message, obtain the information of said input file, return input file response message, the information of carrying said input file of receiving to said client.
Receive in the input file response message, message header comprises the responder of HTTP, comprises the data structure of the input file of reception in the message body.
When server receives the input file success, can generate this message in the following manner:
Represent the responder of " success (OK) " to generate message header according to HTTP;
According to the XML form; According to the reception MSRP path of the information of the input file that receives such as this input file, send at least a among MSRP path, bytes range, successfully report, failure reporting, recipient user's indications, sender user's indications, file date, file content deployment, file content types and the resource URL; Generate the data structure of a file, as message body;
Generate reception input file response message according to said message header and message body.
During below for the success of reception input file, receive the example and the explanation of input file response message content:
HTTP/1.1200OKContent-Type:multipart/form-data;boundary=″===============123456==″;
MIME-Version:1.0
Date:Thu,04Jun?200902:51:59GMT
--===============123456==
Content-Disposition:multipart/form-data;name=”root-fields”
Content-Type:application/xml;charset=″utf-8″
Content-Length:nnnn
<?xnl?version=″1.0″encoding=″UTF-8″?>
< FileTransfer:File xmlns:FileTransfer=" urn:oma:xml:rest:FileTransfer:1 ">the beginning of file data structure
<To-Path>msrp://Peter?E.Xample.example.com:7575/u3978ae283wzd;tcp</To-Path>
<From-Path>msrp://Server.example.com:4000/VL1SmRjx0qhi;tcp</From-Path>
<Success-Report>no</Success-Report>
<Failure-Report>yes</Failure-Report>
<CPIM?to>SIP:user2example.com</CPIM?to>
<CPIM?from>SIP:user1example.com</CPIM?from>
<CPIM?DateTime>2010-05-15T15:02:31-03:00</CPIM?DateTime>
<CPIM?Content-Disposition>attachement;filename=″My?cool?picture.jpg″;creation-date=″Mon,15May201015:01:31+0300″;size=4092</CPIM?Content-Disposition>
<CPIM?Content-Type>image/jpeg;charset=utf-8</CPIM?Content-Type>
<clientCorrelator>567894</clientCorrelator>
<resourceURL>Http: // { apiVersion}/FileTransfer/Terminating/SIP:user2example.co m/FileTransferSessions/{FileTransferSessionId1}/inbound/ file</resourceURL>The resource URL of file
</FileTransfer:File>
--===============123456==
GIF89a...binary?image?data...
--===============123456==--
Embodiment two
Present embodiment relates to the control that is relevant to of the REST API deletion input file that provides based on the communication network territory, based on system identical with embodiment one, the related definition of resource, action and data structure is please with reference to the explanation among the embodiment one.
Fig. 3 is the flow chart of present embodiment based on REST API deletion input file, and this flow process may further comprise the steps:
Step S301: client is the resource of use with the input file of request deletion, sends deletion input file request message to server, carries the resource unified resource position sign (URL) of said resource;
In the deletion input file request message of present embodiment, comprise the action and the resource of use in the message header, can not carry message body.
Client can generate this message in the following manner:
Input file with the request deletion is the resource of use; Deletion (Delete) action with HTTP is the action of use; Generate message header, the resource URL of said resource comprises at least one in terminal participant's (participant of request deletion input file) the indications of user's indications and file transfer session (the corresponding document transmission session of this terminal participant participation).
Generate deletion input file request message according to said message header.
Below with a bright deletion input file request message that once generates of as an exampleBSEMGVR takeN-PSVSEMOBJ.
Suppose that the terminal participant is user Peter E.Xample (SIP:user2example.com), file transfer session is that { FileTransferSessionId1}, this request is the deletion input file.
Below for deleting the example of input file request message content:
DELETE
Http: // serverRoot}/apiVersion}/FileTransfer/Terminating/SIP:user2example.co m/FileTransferSessions/{FileTransferSessionId1}/file HTTP/1.1 the resource URL of action+resource
Accept:application/xml
Host:example.com:80
Step S302: said server is deleted said input file after receiving said deletion input file request message, returns deletion input file response message to said client.
In the deletion input file response message, message header comprises the responder of HTTP, can not carry message body.
During the success of server deletion input file, can generate this message in the following manner:
The responder of representing " no content (No content) " according to HTTP generates message header;
Generate deletion input file response message according to said message header.
During below for the success of deletion input file, the example of deletion input file request message content:
HTTP/1.1204No?content
Date:Thu,04Jun?200902:51:59GMT
Fig. 4 is comprehensive the foregoing description, receives the operation chart of input file and deletion input file between the client and server.
During file transfer is carried out, the input file preservation that can upload onto the server;
Afterwards, client-requested receives input file, may further comprise the steps:
Client generates and receives the input file request message;
User end to server sends said reception input file request message;
Server is resolved and is handled after receiving and receiving the input file request message, obtains the information of said input file;
Server generates and receives the input file response message;
Server returns to said client and receives the input file response message.
Afterwards, client can be carried out the file reception according to the information of input file in the response.
Like client-requested deletion input file, may further comprise the steps:
Client generates deletion input file request message;
User end to server sends deletion input file request message;
Server is resolved and is handled after receiving deletion input file request message, the deletion input file;
Server generates deletion input file response message;
Server returns deletion input file response message to said client.
The content of above-mentioned each message and generation method see also the description in the preceding text, no longer repeat.
In the such scheme; The open telecommunication capability interface of reception and deleted file in the clear specifically document transmission process; The content of each message promptly can satisfy the professional needs of file transfer, goes for related specifications such as the related specifications among the OMA, the IEFT FTP etc. of existing open telecommunication capability again.Greatly facilitating Web developer, third party developer or service provider etc. receives and the relevant control of deleting input file server with the API of REST style neatly.
One of ordinary skill in the art will appreciate that all or part of step in the said method can instruct related hardware to accomplish through program, said program can be stored in the computer-readable recording medium, like read-only memory, disk or CD etc.Alternatively, all or part of step of the foregoing description also can use one or more integrated circuits to realize, correspondingly, each the module/unit in the foregoing description can adopt the form of hardware to realize, also can adopt the form of software function module to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.