1

这里有没有人可能熟悉 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-ERROR: Parsing WSDL: could't load from ' http://sms.chillnethosting.co.za/index.php?r=sms/webservice ' : 需要开始标签,'<' 未找到

WSDL 在我调用我的 URL 时生成:Web Service URL

有任何想法吗?

4

3 回答 3

0

我设法找出问题所在。似乎 WSDL 已缓存在我的浏览器中。我收到的错误是由于我之前犯的错字,但浏览器缓存了它。

感谢所有的答复。

于 2010-03-28T07:58:18.800 回答
0

您是否已声明您的 Web 服务操作?

http://www.yiiframework.com/doc/guide/topics.webservice#declaring-web-service-action

于 2010-03-14T04:53:17.660 回答
0

Yii web 服务的另一个例子——

http://rowsandcolumns.blogspot.com/2011/02/yii-web-service-and-php-soap-client.html

于 2011-02-05T16:48:33.573 回答