Yii Web 服务中的测试方法存在问题
这里有人可能熟悉 yii 框架中的 Web 服务吗?
我声明了以下测试方法:
/**
* Send a single SMS message
*
* @param string $username Username
* @param string $password Password
* @param string $identifier Valid Identifier to use
* @param string $mobileNumber Mobile Number to send message to
* @param string $message Message to send
* @return string 'OK' on success, error message on failure
* @soap
*/
public function singleSms($username, $password, $identifier,$mobileNumber, $message){
return "username=$username, pwd=$password, source=$identifier, mobno=$mobileNumber, msg=$message";
}
但是当我尝试调用此方法时,我得到以下响应:
- - WSDL - SOAP 错误:正在解析 WSDL:无法从 'http:// 加载/sms.chillnethosting.co.za/index.php?r=sms/webservice' :需要开始标记,'<'未找到
当我调用 URL 时,会生成 WSDL: Web 服务 URL
有什么想法吗?
Is there anyone here who might be familiar with web services in the yii framework?
I declared the following test method:
/**
* Send a single SMS message
*
* @param string $username Username
* @param string $password Password
* @param string $identifier Valid Identifier to use
* @param string $mobileNumber Mobile Number to send message to
* @param string $message Message to send
* @return string 'OK' on success, error message on failure
* @soap
*/
public function singleSms($username, $password, $identifier,$mobileNumber, $message){
return "username=$username, pwd=$password, source=$identifier, mobno=$mobileNumber, msg=$message";
}
But when I try to call this method I get the following response:
−
−
WSDL
−SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sms.chillnethosting.co.za/index.php?r=sms/webservice' : Start tag expected, '<' not found
The WSDL generates when I call my URL: Web Service URL
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否声明了您的网络服务操作?
http://www.yiiframework.com/doc/指南/topics.webservice#declaring-web-service-action
Have you declared your web service action?
http://www.yiiframework.com/doc/guide/topics.webservice#declaring-web-service-action
我设法找出问题所在。 WSDL 似乎已缓存在我的浏览器中。我收到的错误是由于我之前输入的错误造成的,但浏览器缓存了它。
感谢您的所有回复。
I managed to figure out what the problem was. It seems that the WSDL was cached in my browser. The error I received was due to a typo I made earlier, but the browser cached it.
Thanks for all the replies.
Yii Web 服务的另一个示例 -
http: //rowsandcolumns.blogspot.com/2011/02/yii-web-service-and-php-soap-client.html
Another example of Yii web service -
http://rowsandcolumns.blogspot.com/2011/02/yii-web-service-and-php-soap-client.html