I need help with Yii WebService (SOLVED)

SOLVED!!  ;D

I can pull up the wsdl just fine, but I can't seem to get my tester function to work properly… I get a blank return, have any of you had this issue before?

wsdl:

http://valhalla-stud…ii/flex/testing

test action:

http://valhalla-stud…s_Yii/flex/test

  /**


   * test yii webservice


   *


   * @return string hello world


   * @soap


   */


  public function getTest()


  {


    return "some text here..";


  }





  public function actionTest()


  {


    $client = new SoapClient('http://valhalla-studios.com/VStudios_Yii/flex/testing');





    echo $client->getTest();


  }

I'm guessing we have the same problem, mine described here:

http://www.yiiframew…pic,1148.0.html

Haven't had time to investigate it further, will dive into it again this weekend.

I'll let you know how it goes.

//Magnus

what version of php are you using? also, what os? My situation might be a little different than yours, I can't switch out my version of PHP so I had to build the soap.so from another version and add it to mine (saw it on a guide somewhere, worked for everyone that used it).

I'm on CentOS 5

Quote

PHP 5.2.6 (cli) (built: May  2 2008 16:06:40)

Copyright © 1997-2008 The PHP Group

Zend Engine v2.2.0, Copyright © 1998-2008 Zend Technologies

    with the ionCube PHP Loader v3.1.29, Copyright © 2002-2007, by ionCube Ltd.

maybe it's a configuration problem?

Quote

Internal Server Error

SoapClient::SoapClient(http://valhalla-studios.com/VStudios_Yii/flex/testing) [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

randomly i'll get this aswell:

Quote

SoapClient::SoapClient(http://valhalla-studios.com/VStudios_Yii/flex/testing) [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

&lt;br /&gt;

HTTP request failed! HTTP/1.1 404 Not Found

can't even get the demo to work properly  :cry: :cry:

http://www.valhalla-…emos/phonebook/

Check the following URL in your browser:

http://www.valhalla-…/phonebook&ws=1

This doesn't seem to be normal. It seems your server has some filters enabled.

like some apache filter? i'm at a loss at where to go now.

Probably. I hadn't encountered this before, so I can't help you much. My only ussgestion is to check apache's error log, and also turn off any apache/php filters.

It definitely seems to be a sever configuration issue, though, since this demo works in many server configurations I tested.

I completely agree, I don't think it is a yii issue. I'll look into apache/php filters, I'm somewhat of an apache noob.

thanks qianq.

I just installed the PEAR soap module, is there anything i need to do to make Yii compatible with it?

Or include nusoap? Or anything so I can at least start developing…  :-[

No, they don't work since Yii uses PHP soap extension.

I would suggest you install a new Web server and PHP. Or perhaps paste here your apache's conf file and php.ini file.

Fixed. I hope this helps someone!  :D :D :D :D :D

I updated the file /etc/hosts

The file /etc/hosts overrides DNS lookup for any domains/addresses that are defined in it. Your /etc/hosts file now has one line:

127.0.0.1 localhost localhost.localdomain

This says "if you're trying to connect to the address localhost or localhost.localdomain, connect to IP address 127.0.0.1". IP address 127.0.0.1 is (typically) the loop-back to the server, and if you enter localhost in your web browser, that's where you should end up.

Before I changed /etc/hosts, it looked like this:

127.0.0.1 valhalla-studios.com valhalla-studios localhost localhost.localdomain

So, the code running on the server would request valhalla-studios.com, and /etc/hosts would redirect the call to IP address 127.0.0.1, the loop-back IP. That messed up the code trying to make a real connection to the web server.

congrat!