Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 27, 2024
Merged

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

merged 1 commit into from
Feb 27, 2024

Conversation

hss-mateus
Copy link
Contributor

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.


soap_operation = operation.element_children.find { |node| node.name == 'operation' }

if soap_operation.nil? || soap_operation['style'] != 'rpc'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind explaining the change here? why do we branch into here only if nil soap operation or the style is (presumably) document

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be refactored to unless soap_operation&.get_attribute('style') == 'rpc'

It just disables the behavior introduced in 4.0 for RPC operations. When the value is nil or document it keeps the current behavior.

@tvdeyen
Copy link

tvdeyen commented Feb 23, 2024

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 pcai merged commit 835f50e into savonrb:main Feb 27, 2024
6 checks passed
@pcai
Copy link
Member

pcai commented Feb 27, 2024

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
Copy link
Contributor Author

Nice, thanks for reviewing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4.0 release breaks integration with style="rpc" operations
3 participants