Open mwolff-fn opened 1 year ago
Intriguing!
Can you provide the Map
class declaration? From my point of view, the Map
should contain an array-typed property or something like this.
Let me know, feel free, if possible, to send me the WSDL at contact@mikael-delsol.fr
Thanks for the quick reply - sent you the files earlier today.
From my point of view, the generated classes match the WSDL definition.
I'm wondering if the SOAP response is well defined and if it does match the WSDL definition.
Maybe if I was able to send the request by myself, maybe I would be able to understand where the issue comes from and if it can be worked around.
Let me know then.
Thanks for looking into it. Unfortunately, the service is within a private network, so you can't access it from the outside. But if it helps, I could probably provide you with a complete protocol of a request/response cycle in private.
Thanks for looking into it. Unfortunately, the service is within a private network, so you can't access it from the outside. But if it helps, I could probably provide you with a complete protocol of a request/response cycle in private.
If you can provide the full XML response, I could work with it I think
Prerequisites
We have a SOAP method getProduct() where the response contains property "externalAttributes", which is defined as a Map struct in the WSDL:
<element name="externalAttributes" nillable="true" type="apachesoap:Map"/>
In the generated proxy class for the response, I see the property generated with the appropriate typehint:
The Map struct class is properly generated and extends WsdlToPhp\PackageBase\AbstractStructBase.
Error message
Now, when I call the method doing the actual SOAP call, I'm getting this exception:
SOAP response
In the raw SOAP response, I see the data represented like this:
Expectation
I would have expected the data to be parsed into the Map class.
What actually happens
While trying to interpret the response and hydrating the proxy class, the client seems to fail identifying the Map struct as such and simply converts the data into an associative array.
When I remove the type hints from the response struct class, the error message goes away and I can see the parsed data structure, which looks like this:
I am currently using PHP8.1, wsdltophp/packagebase:5.0.3 and PackageGenerator 4.1.7.
Is there a possible workaround other than to deactivate strict typing?