Webservcie API of the SMS sending Gateway

Source: Internet
Author: User

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 ();
}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.