First, Introduction
Mobile Dream Network text messaging platform can be sent via SOAP, HTTP GET, HTTP POST, the following is the text I write in Perl through the SOAP send SMS script, it is more than the Dream Web provides PHP, Java is much smaller, and Nagios and other systems can be integrated;
Second, usage
Balance Enquiry: Sendmsgsoap.pl-u user-p password-b
Send SMS: sendmsgsoap.pl-u user-p password-r receiver-m Message
Third, the source code
#!/usr/bin/perl-w#[email protected] UseStrict; Use 5.10.1; UseGetopt::Std; UseSoap::Lite; UseEncode; UseVARs qw/$opt _u $opt _p $opt _r $opt _m $opt _b/; Getopts ('u:p:r:m:b'); #Check balance #usage: $0-u user-p password-bif($opt _b&&$opt _u&&$opt _p ){ my $soap= SOAP::Lite-URI ('http://tempuri.org') Proxy ('Http://61.145.229.29:7903/MWGate/wmgw.asmx', timeout=>5); my $som=$soap->call ('mongatequerybalance',SOAP::D Ata->name ('userId')->value ($opt _u),SOAP::D Ata->name ('Password')->value ($opt _p) ); die $som->faultstringif($som-fault); Print $som->result,"\ n"; #Send SMS #usage: $0-u user-p password-r receiver-m message}elsif($opt _u&&$opt _p&&$opt _r&&$opt _m ){ my $msg= Decode ('UTF8',$opt _m); my $count=Split(',',$opt _r); my $soap= SOAP::Lite-URI ('http://tempuri.org') Proxy ('Http://61.145.229.29:7903/MWGate/wmgw.asmx', timeout=>5); $soap->serializer->autotype (0); my $som=$soap->call ('Mongatesendsubmit',SOAP::D Ata->name ('userId')->value ($opt _u),SOAP::D Ata->name ('Password')->value ($opt _p),SOAP::D Ata->name ('Pszmobis')->value ($opt _r),SOAP::D Ata->name ('pszmsg')->value ($msg),SOAP::D Ata->name ('Imobicount')->value ($count),SOAP::D Ata->name ('Pszsubport')->value ('*'),SOAP::D Ata->name ('MsgId')->value ('0') ); die $som->faultstringif($som-fault); Print $som->result,"\ n"; }Else{ Print "Balance Enquiry: $0-u user-p password-b\n"; Print "Send SMS: $0-u user-p password-r receiver-m message\n"; Exit(1);}
[Tool development] mobile dream Network SMS Sending client