|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44265 incorrect SOAP Encoding ERROR on response
Submitted: 2008-02-27 13:54 UTC Modified: 2008-10-29 01:00 UTC
Avg. Score:3.9 ± 1.4
Reproduced:10 of 10 (100.0%)
Same Version:3 (30.0%)
Same OS:4 (40.0%)
From: gdk-spam at yes-co dot nl Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.2.5 OS: Debian r4.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: gdk-spam at yes-co dot nl
New email:
PHP Version: OS:


 [2008-02-27 13:54 UTC] gdk-spam at yes-co dot nl
The PHP SOAP server incorrectly reports an SOAP-ERROR when the SOAP response is returned in WSDL mode. The error indicates an optional property is missing. The property is defined within a XML Schema sequence which has its 'minOccurs' attribute set to '0', which should make the properties optional.

The WSDL validates correctly against WS-I Basic Profile 1.1 + SOAP Binding Profile 1.0 checks using Mindreef SOAPscope.

We recently upgraded from PHP 5.1.4 to PHP 5.2.4 (ZendCore package). We are unable to reproduce this error in 5.1.4.

We've stripped down the Webservice and request/response, the production code is ofcourse much more complicated.

If you uncomment the 'Letter' and 'Volgnummer' properties the SOAP response is returned without a problem

Reproduce code:

SOAP Server:

SOAP Client:

Expected result:
ws_kadaster_client.php output:

stdClass Object ( )

Actual result:
ws_kadaster_client.php output:

SoapFault Object
    [message:protected] => SOAP-ERROR: Encoding: object hasn't 'Letter' property
    [string:private] => 
    [code:protected] => 0
    [file:protected] => /vol/vol0/home/geoffrey/public_html/ws_kadaster_client.php
    [line:protected] => 11
    [trace:private] => Array
            [0] => Array
                    [function] => __call
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                            [0] => GetKadastraalBericht
                            [1] => Array
                                    [0] => stdClass Object




            [1] => Array
                    [file] => /vol/vol0/home/geoffrey/public_html/ws_kadaster_client.php
                    [line] => 11
                    [function] => GetKadastraalBericht
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                            [0] => stdClass Object




    [faultstring] => SOAP-ERROR: Encoding: object hasn't 'Letter' property
    [faultcode] => SOAP-ENV:Server
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1=""><SOAP-ENV:Body><ns1:GetKadastraalBerichtRequest/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=""><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SOAP-ERROR: Encoding: object hasn't 'Letter' property</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-08 08:02 UTC] benprim at gmail dot com
I had the same issue when i change my WSDL from RPC/Encoded to document literal.

But i think the problem comes from the former way i Use to return my results.

My Response message looks something like this
<xsd:element name="UpdateUserResponseParams">
	<xsd:element name="ReturnValue" type="boolean"></xsd:element>

So i had to change my server code from
function updateUser($user){
	// Internal Code
	return $value;


function updateUser($user){
	// Internal Code
	return array("ReturnValue" => $value);

So I think your server client should be changed to 

public function GetKadastraalBericht($request) {
      $response = new StdClass();
      return array("Letter" => $response->Letter,"Volgnummer" =>$response->Volgnummer);
 [2008-10-21 11:31 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-10-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 12:01:25 2023 UTC