//for the test. The Demo CLASS, returns the JAVA CLASS CLASS object
Jclass CLS=theApp. Env - & gt; FindClass (" test/Demo ");
//according to the CLASS object of a CLASS to obtain an instance of this CLASS
Jobject obj=theApp. Env - & gt; AllocObject (CLS);
//get method in a class, the last parameter is the signature of the method, through the javap - s - p filename can gain
JmethodID mid=theApp. Env - & gt; GetMethodID (CLS, "append", "(Ljava/lang/String; I) Ljava/lang/String;" );
//object structure parameters and call the method
Const char szTest []="telecommunications";
Jstring arg=NewJString (theApp env, szTest);
Jstring MSG=(jstring) theApp. Env - & gt; CallObjectMethod (obj, mid, arg, 12);
String szvalue=https://bbs.csdn.net/topics/JStringToCString (theApp env, MSG);
The following is the interface documentation:
4 HTTP URL call example
4.1 call way
The URL FORMAT:
http://[url] : [port]/[fjyg/]/resource ${ResID}? _app_id_=${_app_id_value} & amp; _license_key_=${_license_key_value} & amp; ParamKey1=${Paramvalue1} & amp; ParamKey2=${ParamValue2}... .
The parameter name description
http://[url] : [port]/[fjyg/]/resource service address such as: localhost: 8080/crtmisweb_pr/resource
ResID service names such as:/syservice ctop/crtmis/owner/getowner
_app_id_value system administrators (call this system the outside of the service interface system ID)
_license_key_ value system administrators (peripheral system ID corresponding identification number)
5 example JAVA API call
5.1 the file configuration (parmas. Ini)
The parameter name description
ServerName service address such as: localhost: 8080/crtmisweb_pr/resource
AppId system administrators (call this system the outside of the service interface system ID)
LicenseKey system administrators (peripheral system ID corresponding identification number)
Note: please put the class directory configured file
5.2 call way
Platform provides ctopsdk jars, encapsulates the HTTP client calls, call as follows:
URSClient=new URSClient (" params2. Ini ");//read the configuration file
UrsClient. The register ();//the first call to need to register
HashMap
//submit parameters setting
Params. Put (" MINRECNO ", "1");
Params. Put (" MAXRECNO ", "10");
//define the interface method to obtain
String outputXml=ursClient. Invoke (this, "SYSMINIBL.COM PANYNAME. PROJECTNAME. CTOPDEMO. VECHICLE. GETVECHICLELIST", params);//in accordance with the service name call
5.3 return data
<? The XML version="1.0" encoding="utf-8"?>