Recently, companies want to find the Web servcie interface of the SMS sending gateway to send their own text messages.Program. I don't know which one provides a clue, but Sina is no longer able. I tried it!CodeAs follows:
/*************************************** **************************
* Sidiw corporation system Dept.
*
* Created on 12:11:45
*
* Author by Java. Sun ver1.0 http://www.sidiw.com.cn
*
* Function:
*
* Note:
*
**************************************** **************************/
Package com. sidiw. SMS. axis;
Import javax. xml. namespace. QNAME;
Import org. Apache. axis. Client. call;
Import org. Apache. axis. Client. Service;
Public class sendsms {
Public void send (){
Try {
String endpoint = "http://smsinter.sina.com.cn/ws/smswebservice0101.wsdl"; // the URL of the called Web Service, which is an HTTP request and the expected result is the WSDL document.
Service = new service (); // create a request service framework instance.
/*
* Org. Apache. axis. Client. Service implement JAX-RPC's
* Javax. xml. rpc. Services Interface
* This interface is used to generate the org. Apache. axis. Client. Call instance mentioned below.
*/
Call call = (CALL) service. createcall (); // generate an instance for maintaining the call from the framework.
/*
* Org. Apache. axis. Client. Call implements the JAX-RPC's javax. xml. rpc. Call interface.
*/
Call. settargetendpointaddress (New java.net. URL (endpoint ));
Call. setoperationname (New QNAME ("http://outlook.microsoft.com/add-ins/SMS/type", "sendxml"); // set the name of the function to be called
String result = (string) Call. Invoke (new object [] {"Sina", "13390 *******",
"Password **", "13951603410", "test mobile phone", "text "});
System. Out. println (result );
} Catch (exception e ){
System. Err. println (E. tostring ());
}
}
Public static void main (string [] ARGs ){
Sendsms test = new sendsms ();
Test. Send ();
}
}