Commit 9ebce5a
authored
WsdlValidator: new WSDL Parser (#2863)
* Add WSDL parsing utilities and schema validation tests
- Introduced comprehensive WSDL parsing utilities (`Definitions`, `Binding`, `Service`, etc.).
- Added schema parsing components with support for `Include` and `Import`.
- Implemented tests for schema validation, WSDL definitions, services, bindings, and operations.
- Enhanced SOAP version detection through `WSDLSOAPVersionExtractor`.
- Refactored `AuthorizationService` and `ResolverMap` for improved URI handling.
* Remove unused WSDLSOAPVersionExtractor and clean up redundant WSDL parser fields
- Deleted `WSDLSOAPVersionExtractor` as it is no longer in use.
- Replaced redundant mutable fields in WSDL parser classes with `final` fields to ensure immutability.
- Simplified WSDL parser constructors by removing unused context (`ctx`) parameters.
- Enhanced code readability by improving method references and streamlining operations.
- Updated comments and removed obsolete code for cleaner structure.
* Enhance WSDL parser with support for cyclic imports, schema inclusion, and improved validation tests
- Added cyclic import handling for WSDL and XSD files, ensuring robust schema parsing in complex configurations.
- Enhanced `Schema` class to include logic for merging elements from included schemas.
- Streamlined `WSDLParserContext` to track and prevent duplicate resource loading.
- Improved schema validation test coverage with new test cases for cyclic and imported elements.
- Minor refactorings in WSDL and schema-related classes for better readability and maintainability.
* Refactor WSDL parser code for immutability and readability
- Replaced mutable fields with `final` to ensure immutability in `WSDLParserContext` and related classes.
- Simplified test method `getDefinitions` by removing intermediate variable.
- Removed redundant null check on the `type` attribute in `Binding`.
- Enhanced code clarity in `PortType` by finalizing the `operations` list.
* Refactor WSDL parser and URI utility for improved normalization, binding, and message handling
- Added robust path normalization in `URIUtil`, covering relative paths, absolute paths, and various URI schemes.
- Enhanced `WSDLParser` to track and validate immutable definitions, bindings, and messages.
- Introduced support for handling empty schema locations and improved error handling in cyclic imports.
- Updated tests to cover added functionality, ensuring reliable parsing and normalization across platforms.
* Add embedded WSDL example and enhance parser robustness for URI normalization and schema imports
- Included `embedded.wsdl` as a test resource for integration scenarios.
- Improved `URIUtil` logic to handle query strings, fragments, and scheme-relative URIs during normalization.
- Enhanced WSDL parser to handle embedded schemas and validate imports with improved error handling.
- Updated tests to ensure accurate parsing and normalization in new and existing edge cases.
* Improve WSDL parser and URI utility
- Streamlined XML schema declarations in `embedded.wsdl`.
- Enhanced `URIUtil` to simplify Windows drive path normalization.
- Refactored WSDL parser for better error handling, schema imports, and embedded schema handling.
- Modernized code by replacing specific types with `var` where applicable.
- Improved `URIUtilTest` to cover Windows drive-relative paths and other edge cases.
* Add copyright headers, logging improvements, and update SOAP namespace handling
- Added Apache 2.0 license headers to all modified files.
- Enhanced SOAP analysis with additional debug logging in `SOAPUtil`.
- Updated XPath expressions in YAML configuration to use explicit SOAP namespace references (`s11`).
- Refactored several test files for consistency and improved readability.
* Add copyright headers, logging improvements, and update SOAP namespace handling
- Added Apache 2.0 license headers to all modified files.
- Enhanced SOAP analysis with additional debug logging in `SOAPUtil`.
- Updated XPath expressions in YAML configuration to use explicit SOAP namespace references (`s11`).
- Refactored several test files for consistency and improved readability.
* Remove unused fields and redundant logic in `WSDLInterceptor`
- Deleted unused `registryWSDLRegisterURL` field and associated methods.
- Removed redundant `HttpClient` logic.
- Simplified `rewrite` method.
- Streamlined imports and improved code readability.
* Remove redundant WSDL utility methods, tests, and dependencies
- Removed unused methods and fields in `WSDLUtil`, `WSDLInterceptor`, and related classes for improved maintainability.
- Deleted `WSDLUtilTest` and redundant SOAP operations tests.
- Replaced specific types with `var` for modernized code.
- Removed dependency on `soa-model-core` and updated `pom.xml` with refined dependencies for Groovy modules.
- Simplified WSDL example handling by removing unused logic and streamlining `embedded.wsdl`.
* Remove `WSDLUtil` class and refactor related utilities
- Deleted `WSDLUtil` and its unused methods for maintainability.
- Replaced redundant logic in WSDL parser classes with utility methods.
- Streamlined SOAP wsdl-related exemplars and refactored embedded schema handling.
- Simplified field initializations and usage of `var` across classes.
- Updated documentation to reflect these changes.
* Add WSDL fault handling and improve parser robustness
- Added new WSDL file (`calculator-fault.wsdl`) with fault definition for testing.
- Updated WSDL parser to support fault direction (`FAULT`) in operations handling.
- Enhanced `Relocator` and related classes by removing unnecessary fields and imports for better readability.
- Added unit test to validate fault handling in operations.
* Refactor WSDL parser: streamline imports, enhance schema handling, and simplify logic
* Remove unused fields and simplify logic in WSDL parser classes
- Deleted redundant `referencingSchema` field in `AbstractIncludeImport`.
- Removed `hasLocalName` method from `WSDLElement`.
- Simplified lambda usage in `Operation` for better readability.
* Refactor WSDL parser: simplify attribute handling, improve SOAP version and style detection, and add unit tests
- Replaced direct field assignments with `getAttribute` for cleaner attribute handling in `BindingOperation` and `Address`.
- Added `BindingStyle` class to improve SOAP version and style handling logic.
- Streamlined `Node` processing in `Binding` and `WSDLElement`.
- Introduced helper methods for SOAP namespace and element checks.
- Added new unit tests (`WSDLParserUtilTest`) for utility methods and `rpcStyle` test case for style detection.
* Simplify `Binding` class by removing unused fields and refining `PortType` and `SOAPVersion` handling logic
* Refactor WSDL parser classes for improved readability and maintainability
- Simplified object initialization and attribute handling across WSDL parser classes.
- Removed redundant fields (`Type`, `Service`, `PortType`, etc.) and unified child node processing logic.
- Introduced `instantiateChildren()` and related helper methods for cleaner element instantiation.
- Enhanced `Binding`, `Operation`, `Message`, and related classes: reduced complexity by eliminating unnecessary lists and utility methods.
- Added `ProtocolOperation` class to handle SOAP operation attributes (e.g., `soapAction`).
- Updated and added unit tests to validate changes.
* Refactor WSDL parser: simplify field initialization, streamline list handling, and enhance readability
- Replaced `get(0)` with `getFirst()` for better semantics in child node initialization.
- Made `imports` and `includes` lists final in `Schema` for immutability.
- Simplified stream operations with method references in `Definitions`.
- Removed unused `addSoapVersion` method and redundant test logic.
* Refactor WSDL parser: simplify attribute handling, enhance fault handling, and optimize child element processing
- Replaced direct field usage with `getAttribute` for cleaner logic (`getName()` in `WSDLElement` and `BindingOperation`).
- Simplified and unified child node processing with `instantiateChildren()` and `instantiateChild()` methods across classes.
- Added `Fault` handling for operations and updated `WebServiceExplorerInterceptor` to include fault details in table rendering.
- Refactored `Operation` to improve input/output/fault message handling with streamlined classes (`Input`, `Output`, `Fault`).
- Introduced `Types` class for better encapsulation of WSDL element processing.
- Updated unit tests to validate refactored fault handling and schema updates.
* Improve WSDL parser exception handling and test assertions
- Replaced `findFirst().get()` with `orElseThrow()` for safer binding retrieval in `Port`.
- Simplified `Definitions` parsing logic by removing unused method parameters and refactoring lambda expressions.
- Updated unit test assertions for better accuracy (`assertNull` replaced with `assertEquals`).
* Fix: include fault details in WebServiceExplorer table rendering
- Added missing `td()` element to ensure proper rendering of fault details in the web service explorer table.
* Refactor WSDL parser: migrate to `record` for `WSDLParserContext`, simplify methods, and enhance exception handling
- Replaced `WSDLParserContext` class with a `record` for better immutability and readability.
- Updated method calls to use record getters (e.g., `ctx.definitions()` instead of `ctx.getDefinitions()`).
- Enhanced exception messages in `WSDLElement` and `Binding` for better debugging.
- Simplified stream and lambda usage across parser classes.
- Added unit test for abstract WSDL service validation (`SOAPProxyTest`).
* Add SOAP 1.2 WSDL file and corresponding tests for enhanced schema validation
- Introduced `hello-soap12.wsdl` in test resources, implementing a SOAP 1.2 example schema for validation purposes.
- Added test cases in `WSDLParserTest` to verify the parsing and validation of SOAP 1.2 bindings (`HelloService`).
- Created `WSDLIncludeImportTest` to test schema include/import scenarios, including cyclic and embedded cases.
- Improved `RelativePathRewriter` in `WSDLPublisherInterceptor` by refining file existence checks and path resolution.
- Minor formatting fixes and refinements in existing code and tests.
* Refactor schema validation and WSDL parser components
- Updated `WSDLMessageElementExtractor` to improve RPC element name handling, ensuring correct direction logic for `INPUT` and `OUTPUT`.
- Fixed a formatting issue in `SchemaElement` constructor for better readability.
- Simplified lambda usage in `getElementNames` method of `WSDLIncludeImportTest`.
- Made `resource` field in `RelativePathRewriter` final for immutability.
* Refactor schema validation and WSDL components
- Split `getPossibleElements` logic in `WSDLMessageElementExtractor` into separate methods for RPC and document styles for better clarity.
- Simplified attribute relocation in `Relocator` by removing redundant `shouldProcess` method and streamlining logic.
- Fixed test assertions in `WSDLIncludeImportTest` for correcting import validation (`get(1)` usage).
- Updated `WSDLPublisherInterceptor` to improve path
* Refactor and enhance URI handling and WSDL/XML components
- Added `normalize` method in `URIUtil` for standardizing paths and URIs.
- Synchronized `resolveToNumber` method in `WSDLPublisherInterceptor` for thread safety.
- Replaced hardcoded schema namespace with constants in `WSDLSchemaExtractor`.
- Removed redundant imports and refactored commentary in multiple classes for clarity.
- Added `XMLNS_NS` constant to `Constants`.
* Refactor URI normalization: rename method for clarity, enhance exception handling, and update references in tests and implementations1 parent dcc5a04 commit 9ebce5a
File tree
85 files changed
+3332
-1249
lines changed- annot/src/main/java/com/predic8/membrane/annot
- core
- src
- main/java/com/predic8/membrane/core
- interceptor
- oauth2/authorizationservice
- schemavalidation
- server
- soap
- proxies
- resolver
- transport/ssl
- util
- soap
- wsdl/parser
- schema
- ws/relocator
- test
- java/com/predic8/membrane
- core
- interceptor/schemavalidation
- proxies
- resolver
- util
- soap
- wsdl/parser
- ws
- integration
- withinternet
- withoutinternet/interceptor
- resources
- validation
- ws
- import
- cyclic
- include
- cyclic
- multiple
- xsd
- inc
- distribution
- examples/extending-membrane/error-handling/custom-error-messages
- src/test/java/com/predic8/membrane/examples/withoutinternet/custom_error_messages
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
85 files changed
+3332
-1249
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 94 | | |
107 | 95 | | |
108 | 96 | | |
| |||
230 | 218 | | |
231 | 219 | | |
232 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
233 | 225 | | |
234 | 226 | | |
235 | 227 | | |
| |||
349 | 341 | | |
350 | 342 | | |
351 | 343 | | |
352 | | - | |
| 344 | + | |
353 | 345 | | |
354 | 346 | | |
355 | 347 | | |
| |||
486 | 478 | | |
487 | 479 | | |
488 | 480 | | |
489 | | - | |
| 481 | + | |
| 482 | + | |
490 | 483 | | |
491 | 484 | | |
492 | 485 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 3 additions & 79 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
32 | | - | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
| |||
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | | - | |
51 | 45 | | |
52 | | - | |
53 | 46 | | |
54 | 47 | | |
55 | 48 | | |
| |||
64 | 57 | | |
65 | 58 | | |
66 | 59 | | |
67 | | - | |
68 | 60 | | |
69 | 61 | | |
70 | 62 | | |
| |||
94 | 86 | | |
95 | 87 | | |
96 | 88 | | |
97 | | - | |
98 | | - | |
| 89 | + | |
| 90 | + | |
99 | 91 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 92 | | |
104 | 93 | | |
105 | 94 | | |
| |||
109 | 98 | | |
110 | 99 | | |
111 | 100 | | |
112 | | - | |
| 101 | + | |
113 | 102 | | |
114 | 103 | | |
115 | 104 | | |
| |||
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 120 | | |
197 | 121 | | |
198 | 122 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
0 commit comments