savonrb / wasabi

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

Fix input/output for `style="rpc"` operations #119

Closed hss-mateus closed 6 months ago

hss-mateus commented 7 months ago

Closes #118

I provided an example WSDL (spec/fixtures/rpc.xml) based on a real one from a service that I use.

Until version 3.8, the gem was generating the following operation:

{
  example_operation: {
    action: "urn:ExampleInterface-ExamplePortType#ExampleOperation",
    input: "ExampleOperation",
    output: "ExampleOperation",
    namespace_identifier: "tns"
  }
}

As for 4.0, it has changed to:

{
  example_operation: {
    action: "urn:ExampleInterface-ExamplePortType#ExampleOperation",
    input: "ExampleOperationRequest",
    output: "ExampleOperationResponse",
    namespace_identifier: "tns"
  }
}

This resulted in a different body when using it in savon:

<soap:Body>
-  <ExampleOperation>
+  <ExampleOperationRequest>
    ...
-  </ExampleOperation>
+  </ExampleOperationRequest>
</soap:Body>

I disabled that behaviour for style="rpc" operations, but I'm not sure if this is the right solution.

tvdeyen commented 7 months ago

We have the same issue with Wasabi 5 (which automatically installed with savon 2.15.). We jumped from Wasabi 3.8 to 5.0 in a minor update.

@pcai please consider to release a Savon v3 with the breaking changes (httpi v4 and wasabi v5) and release a new 2.16 of savon that pins wasabi and httpi back to working releases.

We now solved it for now by pinning wasabi to < 4.

pcai commented 6 months ago

Thanks @hss-mateus - I confirmed the new spec passes in 3.8 and this PR, but fails in 5.0.1. Will make a release today or tomorrow with this fix

hss-mateus commented 6 months ago

Nice, thanks for reviewing it!