【发布时间】:2023-03-24 11:14:02
【问题描述】:
我发现编写 XML 配置来定义 Spring Web 服务非常困难且多余。
示例:
公开 WSDL
对于 JAXB 上下文(定义编组器和解组器)
<bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> </豆> <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPath" value="apps.addition"></property> </豆> <bean id="wsTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> </豆>假设我需要在一个应用程序中实现 100 个 Web 服务,那么所涉及的复杂性是多少。
您能否建议我减少此配置的正确方法。任何注释驱动的方法?
提前致谢
【问题讨论】:
-
你看过 JAX-WS 还是一定是 Spring?
标签: java web-services spring