We are concerned about the development of SMS program (Java)

Source: Internet
Author: User
Tags exit
Program | problem with Asiainfo CMPP1.22API for example (Java)

Aiismg.jcmppapi Bag
Contains class Cmppapi, CMPPDELIVERRESP, Cmppqueryresp etc.

It's no different than a normal procedure.

Cmppapi Pcmppapi = new Cmppapi ();

if (Pcmppapi.initcmppapi (".. /config/javacmppc.ini ")!= 0) {
if (noutput = = 1) {
System.out.println ("Fail to call initcmppapi!");
}
System.exit (1);
}

Cmppsendsingle includes parameter service code, accept phone, send port, billing phone, message format, message level, reply, etc.

if (Pcmppapi.cmppsendsingle (nneedreply, Nmsglevel,
Sserviceid, Nmsgformat,
Sfeetype, Sfeecode,
Svalidtime, Sattime,
Ssrctermid, Sdesttermid,
Nmsglen, Smsgcon,
Smsgid, (byte) 0, NULL, (byte) 0, (byte) 0)!= 0)
{
if (noutput = = 1) {
System.out.println ("Fail to call Cmppsendsingle, error=" + Pcmppapi.geterrcode ());
}
System.exit (1);
}

Receive the program just do a thread through

Private CMPPDELIVERRESP deliver = new Cmppdeliverresp ();
int error = Cmppdeliver (ntimeout, deliver);

To process the returned data. Other companies ' APIs are written in different directions.

Other requirements for advanced functionality can be developed on the basis of the CMPP protocol.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.