Skip to content

Legacy service publisher #1604

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

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft

Legacy service publisher #1604

wants to merge 25 commits into from

Conversation

t-burch
Copy link
Collaborator

@t-burch t-burch commented Feb 12, 2025

No description provided.

@t-burch t-burch marked this pull request as draft February 12, 2025 15:20
@membrane-ci-server
Copy link

This pull request needs "/ok-to-test" from an authorized committer.

- Create `WebServiceOASWrapperTest` and `Xsd2OasSchemaTest` classes for testing functionalities.
- Implement a basic structure for `Xsd2OasSchemaTest` with a test method named `convert`.
- Update `Xsd2OasSchema` to initialize `TYPE_MAPPINGS` with schema instances instead of classes.
- Refactor code in `WebServiceOASWrapper` to improve readability and maintainability, such as extracting the port aggregation logic into a separate method.
Implement tests for converting simple and complex XML elements from XSD to OpenAPI schemas. Verify the conversion of elements, sequences, and date formats, ensuring correct schema types and properties are generated.
@t-burch
Copy link
Collaborator Author

t-burch commented Feb 13, 2025

/ok-to-test

@t-burch
Copy link
Collaborator Author

t-burch commented Feb 13, 2025

  • Has problems with the OpenAPIRecord's rewriter messing up the server URLs
  • Cannot parse XSDs with separated type definitions yet

- Add `getBaseUrl` method in `URLUtil` to obtain base URL based on depth.
- Update `LegacyServicePublisher` to utilize new `getBaseUrl` method for constructing SOAP envelopes.
- Enhance methods for setting SOAP requests and responses to handle both XML and JSON formats.
- Add unit tests for `getBaseUrl` method in `URLUtilTest`.
- Include WSDL for a sample city service in the project.
- Update response handling to correctly obtain the 'Accept' header from the request.
- Remove XML declaration from incoming XML requests for cleaner processing.
- Simplify SOAP envelope creation by directly adding JSON input as a body element.
- Enhance SOAP body extraction using XML DOM parsing for better reliability.
- Adjust JSON to XML conversion to omit XML declaration and set indentation properties.
@predic8
Copy link
Member

predic8 commented Feb 16, 2025

@t-burch looks quite good for that short time

t-burch and others added 12 commits February 17, 2025 09:21
- Add PortMapping class to create OpenAPI definitions from WSDL Port and Service.
- Refactor WebServiceOASWrapper to use the new PortMapping for creating API records.
- Update LegacyServicePublisher to build SOAP requests and responses more cleanly with helper methods.
- Enhance exception handling and XML processing in SOAP body extraction methods.
Introduce comprehensive unit tests for `LegacyServicePublisher` to validate XML processing methods, including extracting SOAP body, converting XML to JSON, and appending child elements. Ensure correctness of key operations with assertions covering valid inputs and expected outputs.
…eptions handling

- Add assertions in `extractBodyFromSoapValidInputReturnsCleanXml` to verify the extracted XML content.
- Implement a new test to validate exception handling for invalid SOAP messages in `extractBodyFromSoapInvalidInputThrowsException`.
- Modify the `LegacyServicePublisher` constructor to initialize `documentBuilderFactory` for namespace awareness.
- Update the response body handling methods to set the content type correctly based on the response format.
…ation. Update LegacyServicePublisher to utilize resource path in JSON-to-XML conversion. Adjust Proxies XML configuration for consistency and improve WSDL file structure.
- Add `camelToKebab` method to `TextUtil` for string formatting.
- Clean up `SpELLablePropertyAware` interface by removing the redundant method.
- Update `PortMapping` to use the new `camelToKebab` method for path item formatting.
- Enhance `city-service.wsdl` by defining operations and response structures for city data retrieval.
- Improve test coverage in `SPeLablePropertyAwareTest` by adding relevant imports.
@christiangoerdes christiangoerdes marked this pull request as ready for review March 13, 2025 12:29
@christiangoerdes christiangoerdes marked this pull request as draft March 13, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants