BeSimple / BeSimpleSoapBundle

NOT MAINTAINED - [READ-ONLY] Subtree split of the BeSimpleSoap -- clone into BeSimple/SoapBundle/ (master at BeSimple/BeSimpleSoap). Please submit issues on BeSimple/BeSimpleSoap repository.
http://besim.pl/SoapBundle/
61 stars 67 forks source link

SoapFault : Wrong Version #61

Closed florentpoiteau closed 11 years ago

florentpoiteau commented 11 years ago

Hi,

my project is on Symfony 2.0.x and I installed your bundle. I'm working on a local config.

I follow all the steps of configuration and exemple on the doc.

Like in doc, I get a wsdl (file or text) on my url http:/localhost/app_dev.php/soap/return.

The wsdl file seems ok :



Then I put a serviceController :


/*
 * @Route("/soap")
 */
class HelloServiceController extends Controller
{

    /**
     * @Route("/hello")
     * @return Response
     * 
     */
    public function indexAction()
    {
        $client = new \soapclient('http://localhost/app_dev.php/soap/return');

        $response = $client->__soapCall('hello', array('name' => 'toto'));

        return $response;
    }
}

And the file which contains the method is :


class ServerController extends ContainerAware
{

    /**
     * @return Response
     * @Soap\Method("hello")
     * @Soap\Param("name", phpType = "string")
     * @Soap\Result(phpType = "string")
     * 
     */
    public function helloAction($name)
    {
        return sprintf('Hello %s!', $name);
    }

At the end when I launch the url : http://localhost/app_dev.php/soap/hello

An error occurs : Wrong Version

I have searched for any solutions but nothing found.

Do you have any idea? Thank you.

florentpoiteau commented 11 years ago

The wsdl File :

<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.kastor.com.localhost/app_dev.php/soap/return" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="return" targetNamespace="http://www.kastor.com.localhost/app_dev.php/soap/return">
  <portType name="returnPortType">
    <operation name="getHello" parameterOrder="name">
      <input message="tns:getHelloRequest"/>
      <output message="tns:getHelloResponse"/>
    </operation>
    <operation name="goodbye" parameterOrder="name">
      <input message="tns:goodbyeRequest"/>
      <output message="tns:goodbyeResponse"/>
    </operation>
  </portType>
  <binding name="returnBinding" type="tns:returnPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getHello">
      <soap:operation soapAction="http://www.kastor.com.localhost/app_dev.php/soap/returngetHello"/>
      <input>
        <soap:body use="literal" namespace="http://www.kastor.com.localhost/app_dev.php/soap/return" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" parts="name"/>
      </input>
      <output>
        <soap:body use="literal" namespace="http://www.kastor.com.localhost/app_dev.php/soap/return" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" parts="return"/>
      </output>
    </operation>
    <operation name="goodbye">
      <soap:operation soapAction="http://www.kastor.com.localhost/app_dev.php/soap/returngoodbye"/>
      <input>
        <soap:body use="literal" namespace="http://www.kastor.com.localhost/app_dev.php/soap/return" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" parts="name"/>
      </input>
      <output>
        <soap:body use="literal" namespace="http://www.kastor.com.localhost/app_dev.php/soap/return" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" parts="return"/>
      </output>
    </operation>
  </binding>
  <service name="returnService">
    <port name="returnPort" binding="tns:returnBinding">
      <soap:address location="http://www.kastor.com.localhost/app_dev.php/soap/return"/>
    </port>
  </service>
  <message name="getHelloRequest">
    <part name="name" type="xsd:string"/>
  </message>
  <message name="getHelloResponse">
    <part name="return" type="xsd:string"/>
  </message>
  <message name="goodbyeRequest">
    <part name="name" type="xsd:string"/>
  </message>
  <message name="goodbyeResponse">
    <part name="return" type="xsd:string"/>
  </message>
</definitions>
bilnader commented 11 years ago

Look in your app/logs/dev.log file for CRITICAL errors.

florentpoiteau commented 11 years ago

Thank you for your answer but my log didn't help me :


[2013-04-16 08:02:49] request.CRITICAL: SoapFault: Wrong Version (uncaught exception) at C:\Projet\src\WebService\SoapBundle\Controller\HelloServiceController.php line 36 [] []

Another idea?

bilnader commented 11 years ago

There is no CRITICAL before that one? Try making your SOAP call like this: $client->hello('toto');

florentpoiteau commented 11 years ago

I tried it, but same result !

The bug is on the saop call, it stops at this line, and I tried so many solutions, I really don't understand why.

Thanks for help !

bilnader commented 11 years ago

Hmm very strange. Could you try one more thing?

$client = new \Soapclient('http://localhost/app_dev.php/soap/return', array('cache_wsdl' => WSDL_CACHE_NONE));

or

$client = new \Soapclient('http://localhost/app_dev.php/soap/return?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE));

florentpoiteau commented 11 years ago

Same results, I tried even with 'soap_version' => SOAP_1_2, 'soap_version' => SOAP_1_1, trace => true, exceptions => true...

Nothing more than this Wrong version !

florentpoiteau commented 11 years ago

Hi,

after some works on it, I found something :

The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller?

I don't know where but ok ...

florentpoiteau commented 11 years ago

Hi,

it seems this bundle didn't support symphony 2.0.x, I tried this bundle on a symfony 2.2 server and works fine. Thanks for help. I close this issue !