subdee / yii2-soap-server

A SOAP server for Yii 2 based on the implementation of Yii 1 framework.
20 stars 28 forks source link

classMap not working? #7

Open philippfrenzel opened 9 years ago

philippfrenzel commented 9 years ago

Hi, I try to map the follwing classes:

public function actions()
  {
      return [
          'SearchLists'=>[
            'class'=>'subdee\soapserver\SoapAction',
            'classMap'=>[
                'SearchRequest' => '\common\models\SOAP\SearchRequest',
                'common\models\SOAP\ResultRecord',
                'common\models\SOAP\names',
                'common\models\SOAP\addresses'
            ],
          ],
          'HelloWorld'=>[
            'class'=>'subdee\soapserver\SoapAction'
          ]
      ];
  }

But whatever I try, the system tells me:

Previous exception: exception 'ReflectionException' with message 'Class SearchRequest does not exist' in /Users/philippfrenzel/Sites/resparty/vendor/subdee/yii2-soap-server/WsdlGenerator.php:392

What can I do, to get that class recognized?!

subdee commented 9 years ago

Hm it seems the classMap is not being used at all for mapping within the generator.

I shall have to look into this as soon as I have time but for now consider the classMap as non-functional.

philippfrenzel commented 9 years ago

That's sad... I would like to use it instead of starting to manage it within the native phpSoap classes... I figured out that the problem is the WSDLGenerator class beeing used, which subsitutes the namespace seperators, before it's getting passed over to the \Reflection() call... I think if you check for the classmap attribute itself than it should work fine... as \Reflection('\random\namespace\class') works!

philippfrenzel commented 9 years ago

Funny.. someone forked your version and looks like he had the same issue... maybe he should make a pull request to fix this!

look here:

https://github.com/CSharpRU/yii2-soap-server/commits/master

subdee commented 9 years ago

Hm thanks for the heads up. I'll contact the author to see if his implementation works and ask him to make a pull request. Regardless, it shouldn't be much work to fix this but I don't have the time to do that immediately.

philippfrenzel commented 9 years ago

thanks for your affords and taking time to reply! ;) I couldn't get his version to run but I already thought about working on a work a round ...

philippfrenzel commented 9 years ago

hi, any news on that?