-
Notifications
You must be signed in to change notification settings - Fork 149
Soap proxy wsdl example #2551
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
Soap proxy wsdl example #2551
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRefactors SOAP fault response construction in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
core/src/main/java/com/predic8/membrane/core/util/SOAPUtil.java (1)
62-68: Use appropriate HTTP status codes for SOAP faults based on fault type.The refactored builder pattern uses
ok()which returns HTTP 200 for all SOAP faults, regardless of the fault type. According to SOAP 1.1 specification, fault responses should return HTTP 500 (Internal Server Error) for server-side faults and HTTP 400 (Bad Request) for client-side faults.The method accepts a
FaultCodeparameter (Server/Client) and correctly serializes it into the SOAP fault XML body, but this distinction is ignored when setting the HTTP response status code. Consider using the FaultCode to determine the appropriate HTTP status:
FaultCode.Server→ HTTP 500FaultCode.Client→ HTTP 400
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
core/src/main/java/com/predic8/membrane/core/util/SOAPUtil.javadistribution/examples/web-services-soap/soap-wsdl-validation/README.mddistribution/examples/web-services-soap/soap-wsdl-validation/apis.yamldistribution/src/test/java/com/predic8/membrane/examples/withoutinternet/validation/SOAPProxyValidationExampleTest.javadistribution/tutorials/getting-started/10-Logging.yamldocs/ROADMAP.md
🧰 Additional context used
🧬 Code graph analysis (1)
core/src/main/java/com/predic8/membrane/core/util/SOAPUtil.java (1)
core/src/main/java/com/predic8/membrane/core/util/xml/XMLUtil.java (1)
XMLUtil(30-111)
🪛 markdownlint-cli2 (0.18.1)
docs/ROADMAP.md
28-28: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (java)
🔇 Additional comments (12)
core/src/main/java/com/predic8/membrane/core/util/SOAPUtil.java (2)
31-31: LGTM! Import changes support the builder pattern refactoring.The static import of
Response.*enables the fluent builder pattern used increateSOAPFaultResponse, and the wildcard import forXMLInputFactory.*appropriately covers the constants used elsewhere in the file.Also applies to: 33-33
62-68: The builder pattern refactoring improves readability.The switch from manual response construction to the fluent builder pattern makes the code cleaner and more maintainable. Exception handling is preserved appropriately.
distribution/tutorials/getting-started/10-Logging.yaml (1)
18-18: LGTM! Improved comment indentation consistency.The adjusted indentation aligns with other example commands in the file.
docs/ROADMAP.md (1)
20-28: LGTM! Clear documentation of log consolidation improvement.The reorganized JMXExporter section and new logs subsection effectively document the planned improvement to consolidate multiple listening port log lines into a single aggregated message.
distribution/examples/web-services-soap/soap-wsdl-validation/README.md (3)
1-3: LGTM! Improved title and description.The updated title and description more clearly convey the purpose of the example and the validator's role in checking SOAP messages against WSDL.
23-23: LGTM! Updated reference to new configuration file.The reference now correctly points to
apis.yaml, aligning with the new YAML-based configuration approach introduced in this PR.
14-16: Change Content-Type totext/xmlfor SOAP 1.1 compliance.The example uses SOAP 1.1 (namespace
http://schemas.xmlsoap.org/soap/envelope/). The curl command should useContent-Type: text/xmlinstead ofapplication/xmlto comply with SOAP 1.1 specifications.Also applies to: 19-21
distribution/examples/web-services-soap/soap-wsdl-validation/apis.yaml (1)
1-23: LGTM! Well-structured SOAP proxy configuration.The configuration clearly defines:
- A SOAP proxy with WSDL-based validation on port 2000
- A test API service on port 2001
- Clear usage instructions in comments
All referenced files (city-service.wsdl, city-soap.xml, invalid-city-soap.xml) are present in the directory.
distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/validation/SOAPProxyValidationExampleTest.java (4)
25-25: LGTM!The static import of Hamcrest matchers enables the improved assertions in the test methods.
35-35: LGTM!The visibility change to package-private follows JUnit 5 best practices, as test methods no longer need to be public.
Also applies to: 51-51
44-45: LGTM!The assertions correctly validate that a valid SOAP request returns a successful response without a fault code.
61-62: LGTM. The assertions correctly validate that an invalid SOAP request produces a fault response. This example uses SOAP 1.1 (indicated by thes11namespace prefix andhttp://schemas.xmlsoap.org/soap/envelope/namespace), where HTTP 200 for fault responses is the correct behavior, confirming the status code expectation and the code comment are both accurate.
|
This pull request needs "/ok-to-test" from an authorized committer. |
Summary by CodeRabbit
Documentation
New Features
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.