spring-boot cxf 集成

坑一

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@Bean
public AegisDatabinding aegisDatabinding() {
return new AegisDatabinding();
}

/**
* 这个要配置成多例模式
*/
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean jaxWsServiceFactoryBean() {
JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean();
sf.setWrapped(true);
sf.setDataBinding(aegisDatabinding());
return sf;
}

@Bean
public Endpoint userEndpoint(UserService userService) {
EndpointImpl endpoint = new EndpointImpl(userService);
endpoint.setServiceFactory(jaxWsServiceFactoryBean());
endpoint.publish("/imCheckRelatedWeixinService.ws");
return endpoint;
}

这里 endpoint.publish 要在最后,否则获取到的 serviceFactory、dataBinding 等参数是空的

  • 本文作者: forever杨
  • 本文链接: https://blog.yl-online.top/posts/b0385cf0.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。如果文章内容对你有用,请记录到你的笔记中。本博客站点随时会停止服务,请不要收藏、转载!