Open feufy78 opened 12 years ago
yes it's a problem, "nillable" for basic types is supported, but no support for objects(?)
adding a
if(null === $message)
{
return null;
}
before the following line:
should fix the problem, can you try this?
Hi, you're the boss!! Problem fixed!
Thanks a lot for your help!
I reopen it because, it hasn't been fixed in the code base yet :)
@francisbesset why is checkComplexType(...) there? is it only to verify that all type and nillable=false constraints are enforced? If this is the case we might think about removing it or providing an option to disable it, because reflection and object graph traversal might result in bad performance. Besides it's in the direction server->client so we don't risk getting invalid or malicous data in...
Hi guys,
Just to let you know I had to modify the RpcLiteralRequestMessageBinder.php too. Same lines were add to the checkComplexType function...
Hi, I'm using Doctrine ODM with mongoDB. This webservice will manage users and their resumes. I've successfully created a soap webservice to do some basic operations on simple documents. However I've have a problem when it comes to work with embedded documents.
Each time I try to load a document without the embedded document (A user without any attached resume), an error is thrown: request.CRITICAL: ErrorException: Warning: spl_object_hash() expects parameter 1 to be object, null given in /var/www/Symfony/vendor/bundles/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php line 66 (uncaught exception) at /var/www/Symfony/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php line 65 [] []
If I try to load a document with the embedded document (A user with an attched resume) the the service works fine and return a User object with a Resume Object inside it.
In my user class I've set the resume property (as embedded document in mongodb) to nillable, but no effect on this bug. /* * @MongoDB\EmbedOne(targetDocument="Resume") * @Soap\ComplexType("Sem\CvtBundle\Document\Resume", nillable=true) * / private $resume;
If I try with the "regular" symfony2 app, the problem wont occur and will load users even if they don't have a resume attached.
Thx in advance for your help.