Joke Collection Website - Blessing messages - Call SMS interface with Java to send SMS to mobile phone. How to write code interface already exists, this is a web address.

Call SMS interface with Java to send SMS to mobile phone. How to write code interface already exists, this is a web address.

Then all you have to do is send data to this URL, such as: publicclass? Httptest 1? {

8?

9publicstaticvoid? main(String[]? args)? {

10?

1 1? Website? Website? =null? ;

12? HttpURLConnection? Kang En? =null? ;

13? OutputStream? Outflow? =null? ;

14? InputStream? inStream? =null? ;

15?

16try{

17? Website? = new? Website (? "? & lt/Param & gt; ?" ? ;

24? sendXml? +="? & ltParam? Name=\?" ? User name \? "? & gt management & lt/Param & gt;; & lt/sigmail command & gt; ?" ? ;

25?

26? Outflow? =? conn . get output stream();

27?

28? //? Are you ready to write XML data through the CONN object?

29? BufferedWriter? bw? = new? BufferedWriter(? New? Java . io . output streamwriter(outStream,

30? "? UTF- 16? ”? ));

3 1? bw . write(send XML);

32? bw . flush();

33? bw . close();

34?

35? //? DataOutputStream? dataOutStream? =? New? DataOutputStream;

36? //? data out stream . write chars(XML);

37? //? data out stream . flush();

38? //? data out stream . close();

39?

40?

4 1? //? Are you ready to read the returned XML data through the CONN object?

42?

43? inStream? =? conn . getinputstream();

44? StringBuffer? returnXml? = new? StringBuffer(? ""? );

45? BufferedReader? rd? = new? BufferedReader(? New? InputStreamReader(inStream,

46? "? UTF- 16? ”? ));

47for? (string? Line? =null? ; ? (line? =? rd.readLine())? ! =null? ; )? {

48? ReturnXml.append (line);

49? }?

50? system . out . println(return XML . tostring());

5 1? rd . close();

52? } catch? (IOException? ex)? {

53? ex . printstacktrace();

54? }? Finally? {

55 years

56? What if? (outflow? ! =null? )

57? out stream . close();

58? What if? (inStream? ! =null? )

59? instream . close();

60? What if? (conn? ! =null? )

6 1? conn . disconnect();

62? } catch? (IOException? e)? {

63? //? Todo? Automatically generated? Catch? Shielding

64? e . printstacktrace();

65? }?

66? }?

67?

68? }?

69?

70? }?