Java SDK

<p class="shortdesc"><a class="xref" href="https://pcp-portal.obs-cn-shanghai.pinganyun.com/sdk%2FMSC-SDK-JAVA-20200109.rar?response-content-disposition=attachment%3Bfilename%3DMSC-SDK-JAVA-20200109.rar" target="_blank">Click to download SDK</a></p> <ol class="ol" id="JavaSDK__ol_urm_f15_xmb"> <li class="li">Overview<p class="p">SDK development and usage instructions.</p></li> <li class="li">Environment information<ul class="ul" id="JavaSDK__ul_hgk_215_xmb"> <li class="li">JDK version: Version 1.6 or above.</li> <li class="li">Encoding format: UTF-8.</li> </ul></li> <li class="li">Content structure<ul class="ul" id="JavaSDK__ul_igk_215_xmb"> <li class="li">sdk_java: SDK source code of java version. </li> <li class="li">demo_java: SDK example of java version.</li> </ul></li> <li class="li">sdk_java<p class="p">Send a http/https request with the generic RestTemplate to realize the features of sending and querying short messages.</p><ul class="ul" id="JavaSDK__ul_jgk_215_xmb"> <li class="li">RestTemplateClient<div class="p">The initializing default HttpClient generates a RestTemplate equipped with a connection pool. If you have an existing RestTemplate in your project, use the existing one. The codes are shown as follows:<table class="table" id="JavaSDK__table_kgk_215_xmb"><caption></caption><colgroup><col></colgroup><tbody class="tbody"> <tr class="row"> <td class="entry"> <p class="p">/**</p> <p class="p">* use the customized restTemplate</p> <p class="p">* @param url address of the interface</p> <p class="p">* @param appid application ID</p> <p class="p">* @param secret secret</p> <p class="p">* @param restTemplate</p> <p class="p">*/</p> <p class="p">public SMSOMCPClient(String url, String appid, String secret, RestTemplate restTemplate)</p> </td> </tr> </tbody></table></div></li> </ul><ul class="ul" id="JavaSDK__ul_v5z_s15_xmb"> <li class="li">AbstractOMCPClient<p class="p">Process the signature logic.</p></li> </ul><ul class="ul" id="JavaSDK__ul_qdf_x15_xmb"> <li class="li">SMSOMCPClient<p class="p">Realize the logic of interfaces including sendmsg (send short messages) and queryResult (query results of the sent short messages).</p></li> </ul><ul class="ul" id="JavaSDK__ul_psx_y15_xmb"> <li class="li">log4j.properties<p class="p">Log configuration files.</p></li> </ul></li> <li class="li">demo_java<ul class="ul" id="JavaSDK__ul_zkk_bb5_xmb"> <li class="li">TestSMSFunction<p class="p">Provide examples of sending short messages and query results of short message sending.</p></li> </ul><ul class="ul" id="JavaSDK__ul_spd_db5_xmb"> <li class="li">log4j.properties<p class="p">Log configuration files.</p></li> </ul></li> <li class="li">Create a development project.<ol class="ol" type="a" id="JavaSDK__ol_wm2_lb5_xmb"> <li class="li">Extract the project, and import the maven project. Click next in the follow-up procedures.<img class="image" id="JavaSDK__image_zfc_3d5_xmb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20203112140407-14f516229e28.png" width="830"><img class="image" id="JavaSDK__image_u3b_jd5_xmb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20203112140407-1f4335be994e.png" width="830"></li> <li class="li">An example for short message testing: @test needs to be added to junit package.<img class="image" id="JavaSDK__image_cdt_jd5_xmb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20203112140407-1ba1a18e9060.png" width="830"></li> </ol></li> <li class="li">Version change records<table class="table frame-all" id="JavaSDK__table_knw_ld5_xmb"><caption></caption><colgroup><col style="width:50%"><col style="width:50%"></colgroup><thead class="thead"> <tr class="row"> <th class="entry colsep-1 rowsep-1" id="JavaSDK__table_knw_ld5_xmb__entry__1">Version</th> <th class="entry colsep-1 rowsep-1" id="JavaSDK__table_knw_ld5_xmb__entry__2">Change records</th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__1 "> <p class="p">1.1.4</p> </td> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__2 "> <p class="p">Added an error message that the maximum size of an uploaded file is 5 MB.</p> </td> </tr> <tr class="row"> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__1 "> <p class="p">1.1.3</p> </td> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__2 "> <p class="p">Fixed the testing environment https and bugs stating that balance alert and frequency alert cannot be sent.</p> </td> </tr> <tr class="row"> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__1 "> <p class="p">1.1.0</p> </td> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__2 "> <p class="p">Added the method fetchNewSms of querying results of MO short messages replied by users.</p> </td> </tr> <tr class="row"> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__1 "> <p class="p">1.0.0</p> </td> <td class="entry colsep-1 rowsep-1" headers="JavaSDK__table_knw_ld5_xmb__entry__2 "> <p class="p">Added short message methods including sendsms, querySmsResult, generateCaptcha, and verifyCaptcha.</p> </td> </tr> </tbody></table></li> </ol>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products