php调用webservice 短信接口-----

jjzaihaozhe 2011-12-14 10:51:31
公司做了一个饮食类的问题,测试好了几家短信接口,最后选择了56 短信网的短信接口(网址是:http://www.56dxw.com),为找一个短信接口,我们公司整理测试了一个月,主要是看稳定性和速度方面吧,觉得它们公司的不错,就选择它们公司了,因为公司总部将投入资金去推广这个网站,短信接口起到了非常重要的作用,所以,我们公司这一块比较慎重,选择短信接口就选择了很长的时间,我看过它们公司的接口文档,觉得接入应该比较简单的,所以,答应领导明天能把接口这一块弄好,现在让我郁闷的是,我调用它们的http的接口没有问题,但调用asp.net webservers的,老是出来 出错:服务器未能识别 HTTP 头 SOAPAction 的值
这个问题,找了很久没有找到原因,我问过我那个朋友,调用它们公司的也是webservers的,它的就可以,我的为啥不行呢


这是我写的一个调用56短信网webservers的例子,

//网址:http://www.56dxw.com

<?php
//短信接口测试程序
//$url = "http://jiekou.56dxw.com/sms/HttpInterface.aspx";
$webService_url = "http://jiekou.56dxw.com/WebServiceInterface.asmx";
$comid= "123"; //企业ID
$username= "test1"; //用户名
$userpwd= "99999"; //密码
$smsnumber= "1061"; //所用平台
$handtel= "1313131312"; //手机号
$sendcontent= "测试成功!success!";
$sendtime= ""; //定时时间
header("content-type:text ml;charset=utf-8");
require_once('nusoap/nusoap.php');
$soap = new soapclient($webService_url.'?WSDL', true); //web service 地址
$soap->soap_defencoding = 'utf-8';
$soap->decode_utf8 = false;
$result = $soap ->call("SendNote",array("handtels" => $handtel,"_content"=>$sendcontent, "userName"=> $username , "password"=>$userpwd , "cid"=>$comid, "_sendtime"=>"" , "_smsnumber"=>$smsnumber ));
if ($soap->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $soap->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {

echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}


请高手帮助一下吧,明天急用呢.........
...全文
356 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
狄默默斯基 2011-12-25
  • 打赏
  • 举报
回复
curl
小在在 2011-12-25
  • 打赏
  • 举报
回复
一个用户名和密码好像只能注册一次
jjzaihaozhe 2011-12-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 q309056448 的回复:]

坐看广告。
[/Quote]晕不是广告哦
helloyou0 2011-12-15
  • 打赏
  • 举报
回复
不是有技术支持吗
代码如诗 2011-12-14
  • 打赏
  • 举报
回复

<?php
include_once('nusoap.php');
$url="http://jiekou.56dxw.com/WebServiceInterface.asmx?WSDL";
$type= "WSDL";
$charset="utf-8";
$param=array(
'handtels'=> "1313131312",//手机号
'_content'=> "hello",
'userName'=> "test1", //用户名
'password'=> "99999", //密码
'cid'=> "123", //企业ID
'_sendtime'=> "", //定时时间
'smsnumber'=> "1061", //所用平台
);

$client = new nusoap_client($url,$type);
if($err = $client->getError()) exit($err);
$client->soap_defencoding = $charset;
$client->decode_utf8 = false;
$client->xml_encoding = $charset;
$result = $client->call("SendNote",$param,'','',false,true);

print_r($result);
?>
q309056448 2011-12-14
  • 打赏
  • 举报
回复
坐看广告。

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧