savonrb / wasabi

A simple WSDL parser
MIT License
90 stars 84 forks source link

Different xml output since wasabi 3.6 update #99

Closed rocket-turtle closed 3 years ago

rocket-turtle commented 3 years ago

Thank you for your time and this gem. We are using the wasabi (3.6.1) gem via the savon (2.12.1) gem.

With wasabi 3.6.1 we get a different xml output.

wasabi 3.5.0

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://servlets.iex.jv.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <tns:mergeToXML>
      <username>user</username>
      <inputDocument>
        <item>
          <data>JVBER ...JUVPRgo=</data>
          <filename>max-mustermann.pdf</filename>
        </item>
      </inputDocument>
    </tns:mergeToXML>
  </env:Body>
</env:Envelope>

wasabi 3.6.1

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://servlets.iex.jv.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <mergeToXML>
      <username xsi:type="xsd:string">user</username>
      <inputDocument xsi:type="tns:inputDocArray">[{:item=&gt;{:data=&gt;"JVBER...JUVPRgo=\n", :filename=&gt;"max-mustermann.pdf"}}]</inputDocument>
    </mergeToXML>
  </env:Body>
</env:Envelope>

If we remove this block the XML is like the XML from wasabi 3.5.0. https://github.com/savonrb/wasabi/compare/v3.5.0..v3.6.1#diff-7c3adc3042c46c5df567b221e60c3442R285

This block comes from this commit: https://github.com/savonrb/wasabi/commit/8b18d4e70c11a0774af02ce165d9358b2311e88a

The .wsdl File looks like this:

<message name="mergeToXML">
<part name="username" type="xsd:string"/>
<part name="inputDocument" type="tns:inputDocArray"/>
</message>

Is there a Problem with the .wsdl File or the commit or savon? Thank you in advance.

olleolleolle commented 3 years ago

Appreciate the digging!

Wasabi does a wrong thing to create "Ruby hash representation", instead of XML, here:

<inputDocument xsi:type="tns:inputDocArray">[{:item=&gt;{:data=&gt;"JVBER...JUVPRgo=\n", :filename=&gt;"max-mustermann.pdf"}}]</inputDocument>

I marked this as a Bug report.

arashm commented 3 years ago

this is also stopping us from updating to version 3.6.

LewisYoul commented 3 years ago

I also struggled with this for some time as part of the savon gem. Have added wasabi to our gemfile now and locked it to 3.5.0.