当前位置:首页 » 网页前端 » 短信web接口
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

短信web接口

发布时间: 2022-04-30 12:31:23

‘壹’ 现在有一个发送短信的WebService接口,怎么调用呢是必须建一个WebService项目吗Web project项目不行吗

WebService接口可以直接在Web项目里使用,在你的项目里添加服务引用就可以了

‘贰’ 如何用java的web程序实现短信业务

看你要如何实现了,简单的使用GSM猫,这个需要通过串口向猫发送命令,然后由猫来负责发送和接收短信。
另外可以直接向移动申请短信服务,通过他们提供的短信接口(CMPP3.0)发送和接收短信,大型的短信应用都是通过这种方式。不过这种方式,如果你的短信量达不到一定数量,是不会给你开通的。那样,你可能需要自己去找其它服务商代理了。
我以前做过一个项目,就是应为短信量不够,没有开通短信网关服务,没有办法用猫的形式做的。
不过,不要向我要代码,涉及到保密。当然代码很简单,就是熟悉你选用的猫的串口协议,然后利用楼上提到的java通信API通过串口发送和接收数据就可以了。

补充回答:
需要Sun的通信API http://java.sun.com/procts/javacomm/
如果你需要,可以留下mail,我可以发给你。

‘叁’ http和web的短信验证码接口有何区别

1、http短信验证码接口和web短信验证码接口所属的协议方式不同。其中HTTPService基于http协议,而webservice基于soap协议。
2、数据处理的效率不一样。相对来说,使用http短信验证码接口的效率比较高一些,它支持客户/服务器模式,运行速度很快,当有用户遇到操作请求的时候,只需要传送请求,其方法还有路径的选择上比较灵活,而HTTP对发送任意类型的不同的数据进行回馈,只不过每一次只能处理一个请求,所以传输的时候效率比较高。而web短信验证码接口也有自己的优势,当遇到一些比较复杂麻烦的数据类型时,处理起来更加有效。
3、跨域处理不同。当选用http这种方式时比较单一,不能进行跨域处理,如果有需要想要调用一个其它应用上的服务时,则需要借助web。
通俗的来讲,不论是使用http短信验证码接口还是web短信验证码接口都可以实现你所想要完成的短信验证、短信群发此类的功能,只不过它们在进行处理时的协议不一样。web就是使用soap协议且能处理一些比较复杂的数据,而httpservice通过post和get方式,可以完成你在本地服务时的一些内容,在不牵涉到跨域时,完全可以满足你的需求。

‘肆’ 怎么做短信的webService接口和第三方服务器端

你需要按接口说明写个service,然后配置成WebService,service三个方法里的具体逻辑根据业务需求写

在spring里配置WebService 很简单,给你一个xfire配置示例

<import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
<bean id="wsExporter" class="org.codehaus.xfire.spring.remoting.XFireExporter">
<property name="serviceFactory" ref="xfire.serviceFactory"/>
<property name="xfire" ref="xfire"/>
<property name="serviceBean" ref="[service实现的bean]"/>
<property name="serviceClass" value="[service接口类]"/>
<property name="name" value="[对外暴露的webservice名称]"></property>
</bean>

‘伍’ 不知道哪家短信平台有Web Service短信接口呢

美联软通,就可以通过调用Web Service发起请求,快速实现短信下发,而且他家的短信平台业务服务范围也非常广泛的。

‘陆’ 要给客户部署短信发布系统,web方式,有开发接口,请推荐几个方案备选

接入式两种:1、web式:根据户配给政企客户管理员帐号/密码通互联网web式登陆行业短信平台使用;2、二发接入式:电信提供二发接口客户根据电信提供二发工具包自行或由第三提供解决案并进行二发接入行业短信平台便于客户更高效使用办公自化系统及产管理系统 谢谢您电信产品关注祝您愉快 信息没解决您问题登录广东电信手机商城(http://m.gd.189.cn)向线客服求助7X24线喔

‘柒’ 短信webservices接口怎么实现

采用web Service接口实现短信收发, 本程序适合网关版本v1.0开发。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SMS.cn.woxp.gateway;
using System.IO;
using System.Xml;
namespace SMS
{

* 如果发送失败原因与通道有关.可能是由于某些原因导致通道关闭.请切换其它通道使用
* 短信通道发送出现延时比较长.建议切换通道发送.[任何短信网关都会出现短信延时.请谅解]
*/

public partial class Form1 : Form
{
private cn.woxp.gateway.WebSMS wsms = new SMS.cn.woxp.gateway.WebSMS();
private string strIdentity = "";
public Form1()
{
InitializeComponent();
}

private void label7_Click(object sender, EventArgs e)
{

}

private void Form1_Load(object sender, EventArgs e)
{
this.l_money.Text = "0.00";
}
private bool CheckGate()
{
int temp = 0;
if (this.t_eid.Text.ToString().Trim() == "" || this.t_gateid.Text.ToString().Trim() == "" || this.t_pwd.Text.ToString().Trim() == "" || this.t_uid.Text.ToString().Trim() == "")
{
MessageBox.Show("网关参数输入不全!请重新输入", "网关参数配置", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
if (!Int32.TryParse(this.t_eid.Text.ToString().Trim(), out temp) || !Int32.TryParse(this.t_gateid.Text.ToString().Trim(),out temp))
{
MessageBox.Show("企业代码或者网关通道ID必须为数字!请重新输入.", "网关参数配置", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
private void button1_Click(object sender, EventArgs e)
{
this.button1.Enabled = false;
if (!CheckGate())
{
this.button1.Enabled = true;
return;
}
if (this.t_sendNo.Text.ToString().Trim() == "" || this.t_sendMemo.Text.ToString().Trim() == "")
{
MessageBox.Show("请输入目标号码和短信内容", "发送短信", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.t_sendNo.Focus();
this.button1.Enabled = true;
return;
}
if (this.t_sendTime.Text.ToString().Trim() != "")
{
DateTime dt;
if (!DateTime.TryParse(this.t_sendTime.Text.ToString().Trim(), out dt))
{
MessageBox.Show("定时发送格式不正确!", "发送短信", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.button1.Enabled = true;
this.t_sendTime.Focus();
return;
}
if (dt <= DateTime.Now)
{
MessageBox.Show("定时发送时间必须大于当前时间!", "发送短信", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.button1.Enabled = true;
return;
}
}
strIdentity= wsms.GetIdentityMark(Int32.Parse(this.t_eid.Text.ToString().Trim()),this.t_uid.Text.ToString().Trim(),this.t_pwd.Text.ToString().Trim(),Int32.Parse(this.t_gateid.Text.ToString().Trim()));
if(strIdentity == null || strIdentity =="")
{
MessageBox.Show("获取身份标识串失败!", "发送短信", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.button1.Enabled = true;
return;
}
string js="";
//全速提交短信
SendResult status = wsms.FastSend(strIdentity,this.t_sendNo.Text.ToString().Trim(),this.t_sendMemo.Text.ToString().Trim(),this.t_sendTime.Text.ToString().Trim(),"");
if(status.RetCode>0)
{
this.l_money.Text = wsms.GetMoney(strIdentity).ToString("0.00");
js="发送成功!共发送:"+status.RetCode.ToString()+"条";
MessageBox.Show(js, "发送短信状态", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
js="发送失败,代码:"+status.RetCode.ToString().Trim()+",原因:"+status.ErrorDesc;
MessageBox.Show(js, "发送短信状态", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

this.button1.Enabled = true;
}

/// <summary>
/// 收到的XML转成dataset型
/// </summary>
/// <param name="xmlData"></param>
/// <returns></returns>
public DataSet ConvertXMLToDataSet(string xmlData)
{
StringReader stream = null;
XmlTextReader reader = null;
try
{
DataSet xmlDS = new DataSet();
stream = new StringReader(xmlData);
reader = new XmlTextReader(stream);
xmlDS.ReadXml(reader);
return xmlDS;
}
catch (Exception ex)
{
string strTest = ex.Message;
return null;
}
finally
{
if (reader != null)
reader.Close();
}
}

private void button2_Click(object sender, EventArgs e)
{
this.button2.Enabled = false;
if (!CheckGate())
{
this.button2.Enabled = true;
return;
}
strIdentity = wsms.GetIdentityMark(Int32.Parse(this.t_eid.Text.ToString().Trim()), this.t_uid.Text.ToString().Trim(), this.t_pwd.Text.ToString().Trim(), Int32.Parse(this.t_gateid.Text.ToString().Trim()));
if (strIdentity == null || strIdentity == "")
{
MessageBox.Show("获取身份标识串失败!", "发送短信", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.button1.Enabled = true;
return;
}
string xml = wsms.ReadXml(strIdentity);
if (xml == null || xml.ToString().Trim()=="")
{
MessageBox.Show("没有收到回复短信!", "接收短信", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.button2.Enabled = true;
return;
}
DataSet ds = new DataSet();
try
{
int code = 0;
if (Int32.TryParse(xml, out code))
{
MessageBox.Show("加载短信失败,原因:" +wsms.GetErrorHint(code), "接收短信", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.button2.Enabled = true;
return;
}
ds = ConvertXMLToDataSet(xml);
}
catch(Exception ex)
{
MessageBox.Show("加载短信异常,原因:"+ex.Message, "接收短信", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.button2.Enabled = true;
return;
}
this.dgv_receive.DataSource = ds.Tables[0];
this.button2.Enabled = true;
}

private void button3_Click(object sender, EventArgs e)
{
this.t_sendMemo.Text = "";
this.t_sendNo.Text = "";
this.t_sendTime.Text = "";
this.button1.Enabled = true;
this.button2.Enabled = true;
this.button3.Enabled = true;
}
}
}

‘捌’ 合通启短信web接口怎么用

接口对接完成后,即可进行短信测试