The biggest problem recently encountered when I was doing this is the contact problem. Another problem is the lack of information. When I encountered a problem, I asked the mobile manager that he was not clear about. When asked Zhuo Wang, he said that he was not engaged in development and he did not know!
After applying for the SMS subscription service, the company will obtain the address and business code for sending the subscription message. The specific message is as follows:
<? Xml version = "1.0" encoding = "UTF-8"?> <SOAP-ENV: Envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: SOAP-ENC = "http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV: header> <TransactionID xmlns = "http://www.monternet.com/dsmp/schemas/"> 00240301659556 </TransactionID> ------ the message number </SOAP-ENV: Header> <SOAP-ENV: body> <SyncOrderRelationReq xmlns = "http://www.monternet.com/dsmp/schemas/"> <Version> 1.5.0 </Version> <MsgType> SyncOrderRelationReq </MsgType> <Send_Address> <DeviceType> 0 </DeviceType> <DeviceID> 0028 </DeviceID> </Send_Address> <Dest_Address> <DeviceID> 400 </DeviceType> <DeviceID> 0 </DeviceID> </Dest_Address> <FeeUser_ID> <UserIDType> 1 </UserIDType> <MSISDN> 13885078893 </MSISDN> -------------------- mobile phone number <pseudo code> </FeeUser_ID> <DestUser_ID> <UserIDType> 1 </UserIDType> <MSISDN> 13885078893 </MSISDN> -------------------- mobile phone number <pseudo code> </DestUser_ID> <LinkID> SP </LinkID> <ActionID> 1 </ActionID> <ActionReasonID> 1 </ActionID>/ actionReasonID> <SPID> 924703 </SPID> -------------------- enterprise code <SPServiceID>-PG </SPServiceID> expose Business Code <AccessMode> 3 </AccessMode> <FeatureStr> UXI = </ featureStr> </SyncOrderRelationReq> </SOAP-ENV: body> </SOAP-ENV: Envelope>
The above is the xml content of the order. We need to include the above mobile phone number, enterprise code, Business Code, and message number (if you do not consider receiving the message to cancel the order, you can ignore it) replace it with the following:
Package com. bx. util; import java. io. bufferedReader; import java. io. file; import java. io. inputStream; import java. io. inputStreamReader; import java. io. outputStream; import java. io. randomAccessFile; import java.net. httpURLConnection; import java.net. URL; import java. util. hashMap; import java. util. list; import java. util. map; import java. util. UUID; import org. jdom. document; import org. jdom. element; import org. jdom. in Put. SAXBuilder; /*** mobile subscription package ** @ author admin_Hzw **/public class cmisc {/*** Reverse Order Request package * @ return */public static String getRequest (String phone, string msgId) {StringBuffer sendStr = new StringBuffer (); sendStr. append ("<? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> "+" <SOAP-ENV: Envelope "+" xmlns: SOAP-ENV = \ "Courier" + "xmlns: SOAP-ENC = \" http: // schemas .xmlsoap.org/soap/encoding/\ "" + "xmlns: xsi = \ "http://www.w3.org/2001/XMLSchema-instance\" "+" xmlns: xsd = \ "http://www.w3.org/2001/XMLSchema\" "+" SOAP-ENV: encodingStyle = \ "http://schemas.xmlsoap.org/soap/encoding/\" "+" xmlns = \ "http://www.monternet.com/dsmp/schemas/\"> "); sendStr. appe Nd ("<SOAP-ENV: Header>" + "<TransactionID xmlns = \" http://www.monternet.com/dsmp/schemas/\ "" + "xsi: type = \" xsd: string \ ">" + msgId + "</TransactionID>" + "</SOAP-ENV: Header>"); sendStr. append ("<SOAP-ENV: Body>"); sendStr. append ("<SubscribeServiceReq xmlns = \" http://www.monternet.com/dsmp/schemas/\ ">"); sendStr. append ("<Version> 1.5.0 </Version>"); sendStr. append ("<MsgType> SubscribeServiceReq </MsgType>"); sendS Tr. append ("<Send_Address>"); sendStr. append ("<DeviceType> 400 </DeviceType>"); sendStr. append ("<DeviceID> 924403 </DeviceID>"); sendStr. append ("</Send_Address>"); sendStr. append ("<Dest_Address>"); sendStr. append ("<DeviceType> 0 </DeviceType>"); sendStr. append ("<DeviceID> 0028 </DeviceID>"); sendStr. append ("</Dest_Address>"); sendStr. append ("<FeeUser_ID>"); sendStr. append ("<UserIDType> 1 </UserIDType>"); sen DStr. append ("<MSISDN>" + phone + "</MSISDN>"); sendStr. append ("<pseudo code/>"); sendStr. append ("</FeeUser_ID>"); sendStr. append ("<DestUser_ID>"); sendStr. append ("<UserIDType> 1 </UserIDType>"); sendStr. append ("<MSISDN>" + phone + "</MSISDN>"); sendStr. append ("<pseudo code/>"); sendStr. append ("</DestUser_ID>"); sendStr. append ("<Service_ID>"); sendStr. append ("<ServiceIDType> 1 </ServiceIDType>"); sendStr. appen D ("<SPID> enterprise code </SPID>"); sendStr. append ("<SPServiceID> Business Code </SPServiceID>"); sendStr. append ("<AccessNo/>"); sendStr. append ("<FeatureStr/>"); sendStr. append ("</Service_ID>"); sendStr. append ("<FeatureStr/>"); sendStr. append ("</SubscribeServiceReq>"); sendStr. append ("</SOAP-ENV: Body>"); sendStr. append ("</SOAP-ENV: Envelope>"); return sendStr. toString ();}/*** simulate return package * @ return */public static String getRe Sult () {StringBuffer r = new StringBuffer (); r. append ("<? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> "). Append ("<SOAP-ENV: Envelope "). append ("xmlns: SOAP-ENV = \" http://schemas.xmlsoap.org/soap/envelope /\""). append ("xmlns: SOAP-ENC = \" http://schemas.xmlsoap.org/soap/encoding /\""). append ("xmlns: xsi = \" http://www.w3.org/2001/XMLSchema-instance \""). append ("xmlns: xsd = \" http://www.w3.org/2001/XMLSchema\ "> "). append ("<SOAP-ENV: Header> "). append ("<TransactionID xmlns = \" http://www.monternet.com/dsmp/schemas /\" & Gt; 9990100019175 </TransactionID> "). append ("</SOAP-ENV: Header> "). append ("<SOAP-ENV: Body> "). append ("<SyncOrderRelationResp> "). append ("<MsgType> SyncOrderRelationResp </MsgType> "). append ("<Version> 1.5.0 </Version> "). append ("
This is a reverse order and has been tested successfully. However, the reverse order is too "wang ba". If the message is sent to your mobile phone, you will receive the fee deduction information ...... the fee will take effect immediately.
Remember that the message must be sent on the machine corresponding to the ip address you applied for. Otherwise, the error code "9017" will be returned: the ip address is invalid.