phpro / soap-client

A general purpose SOAP client for PHP
MIT License
858 stars 175 forks source link

I am getting SOAP-ERROR: Encoding: object has no 'mapped' property #537

Closed dutsik-p closed 2 months ago

dutsik-p commented 3 months ago

Hi

I have used a wizard to generate the types, client and the factory.

When I try to use it. I always receive an issue: SOAP-ERROR: Encoding: object has no 'mapped' property despite the fact the the properties are set.

            $response = $this->client->findCommons(
                new Type\FindCommons(
                    $this->token,
                    (new Type\ItemSearchCriteria())
                        ->withAttributeIdsCriteria([
                            (new Type\AttributeIdsCriteria())
                                ->withAttributeIds([8090])
                            ->withCriterion(0)

                        ])
                        ->withMapped(true)
                        ->withItemStateIds([400])
                    ->withMergeWithSuperItem(false)
                )
            );

if i go to generated type classes and make those props as public. all works like a charm.

What am I missing? I am using the latest version of the package 3.3.0.

veewee commented 3 months ago

Hello

If making the props public works for you. Than that might be a way to continue.

The provided information is not sufficient for me to see the why of it. Can you provide the WSDL?

Does the class by any chance extend a base class with private props? Cause that is known to cause some issues. See https://github.com/phpro/soap-client/issues/523

This issue has been solved for V4 which is currently in experimental Alpha. You might want to check that out as well.