Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catchable Fatal Error: Object of class #97

Open
ghost opened this issue May 4, 2017 · 0 comments
Open

Catchable Fatal Error: Object of class #97

ghost opened this issue May 4, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented May 4, 2017

Good day,

Please your help!

I built a Web service, but when I execute it. I got the next issue:

http://localhost:8000/app_dev.php/ws/AplicationService?wsdl

Catchable Fatal Error: Object of class Symfony\Component\Config\ConfigCache could not be converted to string

Consiguratiion:
#PruebaConrroller.php

"<?php

namespace Acme\SOAPBundle\Controller;

use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Container;

class PruebaController implements ContainerAwareInterface
{
/**
* Sets the container.
*
* @param ContainerInterface|null $container A ContainerInterface instance or null
*/
public function setContainer(ContainerInterface $container = null){
$this->container = $container;
}

/**

  • @soap\Method("hello")
  • @soap\Param("name", phpType = "string")
  • @soap\Result(phpType = "string")
    */
    public function helloAction($name)
    {
    return $this->container->get('besimple.soap.response')->setReturnValue(sprintf('Hello!', $name));
    }
    }"

#routing.yml

acme_soap_homepage:
path: /
defaults: { _controller: AcmeSOAPBundle:Default:index }
acme_soap:
resource: '@AcmeSOAPBundle/Controller/'
type: annotation
_besimple_soap:
resource: 'be_simple_soap.yml'
prefix: /ws

#be_simple_soap.yml

_webservice_call:
path: /{webservice}
defaults: { _controller: BeSimpleSoapBundle:SoapWebService:Call }
requirements:
_format: xml
methods: POST

_webservice_definition:
path: /{webservice}
defaults: { _controller: BeSimpleSoapBundle:SoapWebService:Definition }
requirements:
_format: xml
methods: GET

#config.yml

be_simple_soap:
services:
AplicationService:
namespace: http://localhost:8000/app_dev.php/ws/AplicationService
binding: rpc-literal
resource: '@AcmeSOAPBundle/Controller/PruebaController.php'
resource_type: annotation

#SoapWebServiceController.php

"<?php

/*

  • This file is part of the BeSimpleSoapBundle.
  • (c) Christian Kerl [email protected]
  • (c) Francis Besset [email protected]
  • This source file is subject to the MIT license that is bundled
  • with this source code in the file LICENSE.
    */

namespace BeSimple\SoapBundle\Controller;

use BeSimple\SoapBundle\Handler\ExceptionHandler;
use BeSimple\SoapBundle\Soap\SoapRequest;
use BeSimple\SoapBundle\Soap\SoapResponse;
use BeSimple\SoapServer\SoapServerBuilder;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;

/**
.....
/
class SoapWebServiceController Implements ContainerAwareInterface
{
/
*
* Sets the container.
*
* @param ContainerInterface|null $container A ContainerInterface instance or null
*/
public function setContainer(ContainerInterface $container = null){
$this->container = $container;
}

#autoload.php

"<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

/** @var ClassLoader $loader */
$loader = require DIR.'/../vendor/autoload.php';
//Load BesimpleSoap
$loader->add('BeSimple\SoapCommon' , DIR.'/../vendor/besimple-soapcommon/src');
$loader->add('BeSimple\SoapServer' , DIR.'/../vendor/besimple-soapserver/src');
$loader->add('BeSimple\SoapClient' , DIR.'/../vendor/besimple-soapclient/src');
$loader->add('BeSimple\SoapClient' , DIR.'/../vendor/besimple-soapclient/src');
$loader->add('BeSimple', DIR.'/../vendor/bundles');

// var_dump ($loader);
// exit();

AnnotationRegistry::registerLoader([$loader, 'loadClass']);

return $loader;

#AppKernel.php

"<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new Acme\SOAPBundle\AcmeSOAPBundle(),
new BeSimple\SoapBundle\BeSimpleSoapBundle(),
];

    if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
        $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
        $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
        $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants