Skip to content

Add support for Spring WS auto WSDL/XSD exposure #9635

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

Closed
wants to merge 1 commit into from

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Jun 29, 2017

This PR adds support for auto-configuration of Spring WS automatic WSDL and XSD exposure i.e. registration of WsdlDefinition and XsdDefinition beans. The bean registration is triggered by configuring spring.webservices.wsdl-locations/spring.webservices.xsd-locations properties which will search the provided locations for WSDL/XSD files and register appropriate beans.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 29, 2017
@philwebb philwebb added this to the 2.0.0.M4 milestone Jul 5, 2017
@philwebb philwebb added priority: normal type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 5, 2017
@vpavic vpavic force-pushed the ws-wsdl-exposure branch from 6ee6498 to abbf55d Compare July 27, 2017 20:21
@wilkinsona wilkinsona modified the milestones: 2.0.0.M4, 2.0.0.M5 Jul 28, 2017
@snicoll
Copy link
Member

snicoll commented Sep 19, 2017

Thanks @vpavic - I had a look and I was wondering if it wouldn't be a good thing to illustrate this feature in the existing sample? Some documentation update is probably also in order. Would you be willing to rework the PR?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Sep 19, 2017
@vpavic
Copy link
Contributor Author

vpavic commented Sep 19, 2017

Yes, I agree it would be a good idea to include this in the existing sample. I'll address that and the docs over the next day or two.

Another point I wanted to discuss is whether we can simplify this to use a single location (and therefore a single configuration property) for both WSDLs and XSDs? The reason that led me to think in that direction is that WSLDs will typically have relative links to XSDs, so if you want the link to work locally you'll use something like ../xsd/schema.xsd which naturally won't work in published WSDL.

@vpavic
Copy link
Contributor Author

vpavic commented Sep 20, 2017

I've update the PR with some documentation of the new feature. The sample is also updated, and while it still uses the generated WSDL, the XSD schema @Bean is now configured using the new feature, rather than manually.

Any feedback on the idea of making it a single configuration property?

@Configuration
@EnableWs
protected static class WsConfiguration {

}

private static class WsdlDefinitionBeanFactoryPostProcessor
Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be a lot of shared functionality between WsdlDefinitionBeanFactoryPostProcessor and XsdSchemaBeanFactoryPostProcessor. I think it would be better to merge these two into one class, giving the varying parameters (property name, file extension, and bean class) as constructor arguments. ensureTrailingSlash and createBeanDefinition could then also move to said class.

@snicoll
Copy link
Member

snicoll commented Sep 21, 2017

@vpavic a single property works for me. We can certainly create another one if the need arise I guess?

@vpavic
Copy link
Contributor Author

vpavic commented Sep 21, 2017

Thanks for the feedback @poutsma and @snicoll. I'll update the PR soon.

This commit adds support for auto-configuration of Spring WS automatic WSDL and XSD exposure i.e. registration of `WsdlDefinition` and `XsdDefinition` beans. The bean registration is triggered by configuring `spring.webservices.wsdl-locations` property which will search the provided locations for WSDL/XSD files and register appropriate beans.
@vpavic
Copy link
Contributor Author

vpavic commented Sep 21, 2017

PR updated - there's a single property now, and a single BeanFactoryPostProcessor as well.

@snicoll snicoll self-assigned this Sep 25, 2017
@snicoll snicoll removed the status: waiting-for-feedback We need additional information before we can continue label Sep 25, 2017
snicoll pushed a commit that referenced this pull request Sep 25, 2017
This commit adds support for auto-configuration of Spring WS automatic
WSDL and XSD exposure i.e. registration of `WsdlDefinition` and
`XsdDefinition` beans. The bean registration is triggered by configuring
`spring.webservices.wsdl-locations` property which will search the
provided locations for WSDL/XSD files and register appropriate beans.

See gh-9635
@snicoll snicoll closed this in 15de653 Sep 25, 2017
snicoll added a commit that referenced this pull request Sep 25, 2017
* pr/9635:
  Polish "Add support for Spring WS auto WSDL/XSD exposure"
  Add support for Spring WS auto WSDL/XSD exposure
@vpavic vpavic deleted the ws-wsdl-exposure branch September 25, 2017 13:24
@snicoll
Copy link
Member

snicoll commented Sep 25, 2017

Thanks @vpavic, this is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants