SP SMS Development -Provision Interface Implementation - Reversible Example Code

xiaoxiao2021-03-30  190

Reverse cancellation interface specification - process description

1) SP instead of the user, initiate reverse cancellation requests for MISC UnsubscribeServiceReq

And wait for MISC processing

2) MISC's source address, corporate code, judge whether it is allowed

The SP is reversed in reverse

3) After the access authentication is successful, the user authentication and ordering relationship is performed, and the user is determined.

Whether the state is correct and there is a subscription relationship

4) After the above authentication is successful, MISC sends a subscription relationship synchronous request package to the SP.

SyncorderReLanceReq

5) After the SP receives the synchronous request, the corresponding cancellation process is made to the order request, and return

Synchronize SyncOrderReranceResp

6) After the MISC receives the response, it is determined whether the response value is 0. If the answer value is 0, then

The order relationship is canceled in the MISC, and the SP returns a successful reverse cancellation process.

UnsubscribeServiceResp; if the answer value is not 0, the order relationship is not canceled, the same

Return to SP Back to Unsubscriber UnsubscribeServiceResp

7) SP If the error response from MISC is received, the cancellation failed, and the SP must lose this.

Losing messages are handled, such as recovering the canceled order relationship, and more.

8) If you receive the correct response of your MISC, the sp can not be processed.

11, reverse cancellation interface message definition

• Function Description

This interface is used for the user to cancel the subscribed data service through the SP, and the SP first cancels the user's request to MISC. After the MISC is successfully canceled, the SP cancels the service ordering relationship corresponding to the user.

Message name

Message type

News direction

UnsubscribeServiceReq

REQUEST

SP

àmisc

UnsubscribeServiceResp

Response

MISC

àsp

Interface content description

UnsubscribeServiceReq

Message field description

:

Field name

importance

Types of

Description

MSGType

have to

String

Message type

TransactionID

have to

String

This message number (cannot exceed 16 digits)

Version

have to

String

The version number of the interface message, all interface messages

The version is "1.5.0"

Send_address

have to

Address_INFO_SCHEMA

Sender's address

DEST_ADDRESS

have to

Address_INFO_SCHEMA

Receiver's address

Feeuser_id

have to

User_id_schema

Billing user logo

Destuser_id

have to

User_id_schema

Use user ID

When using the user and billing user for the same user,

FeEUser_ID and Destuser_ID are the same.

Service_id

have to

Service_id_schema

Service logo

UNSUBSCRIBESERVICERESP Message Field Description:

Field name

importance

Types of

Description

MSGType

have to

String

Message type

TransactionID

have to

String

This message number

Version

have to

String

The version number of the interface message, all of this interface

The version of interest is "1.5.0"

Hret

have to

Integer

return value. For specific definitions, see "MISC"

System SMS SP Access Guide - Interface Reconstruction Volume

Reverse instance code in reverse.

The following code retains ownership. Please don't reprint it.

<% @ page language = "java" contenttype = "text / html; charSet = GB2312" Import = "java.sql. * "%>

<% @ include file = "../ cos / cos.jsp"%>

<% @ include file = "fun.jsp"%>

<% @ Page Import = "java.util. *"%>

<% @ Page Import = "java.net. *"%>

<% @ Page Import = "java.io. *"%>

<% @ Page Import = "com.aaa.appk. *"%>

<%!

Private string sendreq (String TransactionID, String SP_ID, String Dest_Mobile,

String Fee_Mobile, String Service, String SpNumber, String Send_DeviceId, StringBuffer BF) {

String Sreturn = "Success";

Try

{

//Http://dsmp.gd.monternet.com/dsmp/dsmp.wsdl

// ??? p: //211.136.253.116/dsmp/dsmp.wsdl

String surl = "

http://211.136.253.116/dsmp/dsmp.wsdl ";

SURL = SURL.TRIM ();

URL URL = New URL (SURL);

HttpurlConnection Connection = (httpurlconnection) URL.OpenConnection (); // Establish a connection

Connection.SetRequestMethod ("post");

Connection.SetDoinput (TRUE);

Connection.SetDoOutput (TRUE);

Connection.SetuseCaches (FALSE);

Connection.SetRequestProperty ("Content-Type", "Text / XML; Charset = UTF-8");

PrintWriter out = new printwriter ()); // Prepare output data.

/ / Reverse XML UnsubscribeServiceReq package data is written in StringBuffer.

StringBuffer Xmlstr = new stringbuffer ("");

XMLSTR.Append ("

XMLSTR.Append ("XMLns: soap-env = /"

http://schemas.xmlsoap.org/soap/envelope// "");

Xmlstr.Append ("XMLns: soap-enc = /" http://schemas.xmlsoap.org/soap/encoding// "");

XMLSTR.APpend ("XMLns: XSI = /"

http://www.w3.org/2001/xmlschema-instance/ "");

XMLSTR.APpend ("XMLns: XSD = /"

http://www.w3.org/2001/xmlschema/ "" ");

Xmlstr.Append ("soap-env: encodingstyle = /"

http://schemas.xmlsoap.org/soap/ENCoding// "");

Xmlstr.Append ("XMLns = /"

Http://www.monternet.com/dsmp/schemas// ">");

XMLSTR.Append ("");

Xmlstr.Append ("

Http://www.monternet.com/dsmp/schemas// "XSI: Type = /" XSD: String / "> 0011" Dest_Mobile "");

Xmlstr.Append ("");

Xmlstr.Append ("");

Xmlstr.Append ("

Http://www.monternet.com/dsmp/schemas// ">");

XMLSTR.APpend (" 1.5.0 ");

Xmlstr.Append (" unsubscribeServiceReq ");

Xmlstr.Append ("");

Xmlstr.Append (" 400 ");

Xmlstr.Append ("" sp_id "");

Xmlstr.Append ("");

Xmlstr.Append ("");

Xmlstr.Append (" 0 ");

Xmlstr.Append (" 0011 ");

Xmlstr.Append ("");

Xmlstr.Append ("");

XMLSTR.Append (" 1 ");

Xmlstr.Append ("" feedn> "); XMLSTR.APpend (" ");

Xmlstr.Append ("");

XMLSTR.APpend ("");

XMLSTR.Append (" 1 ");

XMLSTR.APpend ("" dest_mobile "");

Xmlstr.Append (");

Xmlstr.Append ("");

Xmlstr.Append ("");

Xmlstr.Append (" 1 ");

Xmlstr.Append ("" sp_id "");

XMLSTR.APpend ("" service "");

XMLSTR.APpend ("");

Xmlstr.Append ("");

XMLSTR.APpend ("");

Xmlstr.Append ("");

Xmlstr.Append ("");

Xmlstr.Append (");

/ / Output data to MISC

Out.println (xmlstr.tostring ());

// Save the output data to BF,

bf.append ("start");

bf.append (xmlstr.tostring ());

bf.append ("end");

Out.close ();

// read the data returned by the connection. UnsbscribeServiceResp? SyncORDERRELATIONREQ? SyncORDERRELATIONRESP?

BufferedReader IN = New BufferedReader (New InputStreamReader ()));

String line;

While ((line = IN.Readline ())! = null) {

bf.append ("rstart");

bf.append (line);

bf.append ("rend");

}

In.Close ();

}

Catch (Malformedurlexception E)

{

Sreteurn = "fail";

BF.Append ("WAP Connect SP Error1: E.toString ());

}

Catch (IOException E)

{

Sreteurn = "fail";

BF.Append ("WAP Connect SP Error2:" E.TOString ());

}

Return Sreturn;

}

%>

<%

String phoneno = getString (Request.getParameter ("Phoneno"));

INT app = getint (Request.getParameter ("app"));

IF (phoneno == null) phoneno = ""

String serviceID = "";

IF (app == 2) {

ServiceId = "- otyx";

} else if (app == 1) {

ServiceId = "- olby";

} else if (app == 3) {

ServiceId = "- otyx";

} else if (app == 6) {

ServiceId = "- otyx";

}

String res = NULL;

String command = getString (Request.GetParameter ("Command"));

IF (Command! = Null && Command.equals ("Send") && Phoneno! = null && phoneeno.length ()> 0) {

String TransactionId = system.currenttimemillis () "";

String send_deviceid = "10666666";

String feeuser_id = phoneno;

String destuser_id = Phoneno;

String spservicEid = serviceId;

String sp_code = "456789";

Transaction ID = sp_code transactionid.substring (sp_code.length () - (15-TransactionId.Length ()), TransactionId.Length ());

StringBuffer SB = New StringBuffer ("");

String restr = sendreq (TransactionID, SP_CODE, DESTUSER_ID, FEEUSER_ID, SPSERVICEID, Send_DeviceId, Send_DeviceID, SB);

RES = restr;

//out.println ("res :" restr "full:" sb.tostring ()); // You can read, after sending UNSUBSCRIBESERVICEREQ data, the data returned by MISC,

}

Collection apps = NULL;

IF (phoneno.length ()> 0) {

Apps = bizutil.list ("Select * from userreg u, account a where u.id = a.id and a.phonenum = '" phoneno "");

}

%>

Untitled Document </ Title></p> <p></ hEAD></p> <p><script language = "javaScript" type = "text / javascript"></p> <p><! -</p> <p>Function Send (ID) {//v3.0</p> <p>Formi.command.value = "send";</p> <p>Formi.app.value = id;</p> <p>Formi.submit ();</p> <p>}</p> <p>// -></p> <p></ script></p> <p><body></p> <p><Tabie Width = "100%"></p> <p><tr></p> <p><TD> <Table Width = "100%"></p> <p><form name = "form1" method = "post" action = "ca Zancel.jsp"></p> <p><tr></p> <p><TD COLSPAN = "5" BGColor = "# fffcc"></p> <p><p> o? 㞉 <input type = "text" name = "phoneno" value = "<% = phoneno%>"></p> <p><Input Type = "Submit" Name = "Submit2" Value = "2?"></p> <p><Input name = "command" type = "hidden" id = "command"></p> <p><Input Name = "App" type = "hidden" id = "app"></p> <p></ td></p> <p></ TR></p> <p><% IF (apps! = null&prs.size ()> 0) {%></p> <p><tr></p> <p><TD Height = "22" BGColor = "# 00cccc"> <strong></p> <p>??? 3? / Strong> </ td></p> <p><TD BGCOLOR = "# 00cccc"> <strong> ???? Strong> </ td></p> <p><TD BGCOLOR = "# 00cccc"> <strong>? 2? ¨ · </ strong> </ td> <td bgcolor = "# 00cccc"> <strong> ???? ¨ · </ strong> </ td ></p> <p><TD BGCOLOR = "# 00cccc"> <strong> ?? </ strong> </ td></p> <p></ TR></p> <p><% for (iTerator i = apps.iterator (); I.hasnext ();) {</p> <p>Hashmap r = (havehmap) i.next ();</p> <p>INT ProID = GetInt (R.Get ("ProID"));</p> <p>String name = ""</p> <p>String code = "";</p> <p>INT flag = getint (R.Get ("flag"));</p> <p>IF (ProID == 1) {</p> <p>Name = "8 ¨ © ???;</p> <p>CODE = "- lby";</p> <p>} else if (ProID == 2) {</p> <p>Name = "??? ¡</p> <p>Code = "- jyx";</p> <p>} else if (ProID == 3) {</p> <p>Name = "??? | ̥ ¢;</p> <p>Code = "- lyx";</p> <p>Else if (ProID == 6) {</p> <p>Name = "?? ¡὿";</p> <p>Code = "- llyx";</p> <p>}</p> <p>INT Prevnum = GetInt (R.Get ("prevnum");</p> <p>String registerTime = getString (R.Get ("regtime");</p> <p>String unregatime = getString (R.Get ("UnregTime");</p> <p>%></p> <p><tr></p> <p><TD></p> <p><% = Name%></p> <p></ td></p> <p><TD> <% = Code%> </ TD></p> <p><TD> <% = regtime;%> </ td></p> <p><TD> <% = unregatime%> </ td></p> <p><TD> <% = (FLAG = I? "<a href = '#' οnclick = 'send (" proid ");'>? ?? </a>": "????") %> </ td></p> <p></ TR></p> <p><%}%></p> <p><%}%></p> <p></ form></p> <p></ Tabie> </ TD></p> <p></ TR></p> <p></ tabie></p> <p></ body></p> <p></ html></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-130702.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="130702" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.034</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'MsqYynMpZOEwUy18eFjOesbac2bS7DeHAFRKIpjGm2bBx9tkeKzVZdhUuv7roxcjYV6DZ0qJFqbuBtN8pvcAOA_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>