WsdlToPhp / PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP
https://providr.io
MIT License
426 stars 73 forks source link

Problem with Microsoft .NET Server returning diffgram in XML #205

Closed Enkrod closed 4 years ago

Enkrod commented 4 years ago

So, apparently the Microsoft .NET SOAP-Server utilizes diffram-tags in their answers, which are not addressed in the WSDL or in schemes.

Consequently, at the point my result-object should contain an object of the class KVErgebnis it instead contains XML looking like this:

["schema"]=> string(32697) "
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="KVErgebnis">
    <xs:element name="KVErgebnis" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
        ...
    </xs:element>
</xs:schema>"

["any"]=> string(184816) "
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    <KVErgebnis xmlns="">
        ...
    </KVErgebnis>
</diffgr:diffgram>"

If I understand this correctly, the schema should inform the new objects being build, but it does not contain the diffgram and as a result the XML of the diffgram-tag does not get turned into php-objects?

I don't have the slightest Idea how to work around that and if I remove the diffgram by hand, how to reevaluate the xml into an object.

Could you please advise? Thank you very much!

mikaelcom commented 4 years ago

Is it possible to have the WSDL? You can contact me at contact@mikael-delsol.fr if necessary.

Enkrod commented 4 years ago

Happy new year!

I've mailed you the WSDL-file as well as the XML-response that fails to parse.

mikaelcom commented 4 years ago

Happy New Year too!

I think there is no way to have a the XML data mapped to PHP object as the CalcZusatzversicherungResult is defined by the class:

class CalcZusatzversicherungResult extends AbstractStructBase
{
    /**
     * The schema
     * Meta information extracted from the WSDL
     * - ref: s:schema
     * @var \DOMDocument
     */
    public $schema;
    /**
     * The any
     * @var \DOMDocument
     */
    public $any;
}

Based on the XML schema:

<s:element minOccurs="0" maxOccurs="1" name="calcZusatzversicherungResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema" />
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>

So it can be whatever the WS provider wants! Good luck!

Enkrod commented 4 years ago

Ah damn. But thank you for your time and help.