`
liaofeng_xiao
  • 浏览: 126261 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Spring ServletEndpointSupport整合Axis

阅读更多
使用Spring开发Axis web service服务器端

(那一套都是自动生成的,Locator,Service,ServiceImpl,Stub,Skeleton等等)

现需要在ServiceImpl中添加自己的逻辑,并且需要Spring中的Bean

我是使Skeleton继承了ServletEndpointSupport去获得Bean,在客户端调用(另一项目组)时发现获取不到Bean

但是如果自己使用Spring的ApplicationContext能够加载到(自己写了个main方法进行模拟客户端测试就能够获取)

Spring-references.pdf中有文字如下:
Our AccountServletEndpoint needs to run in the same web application as the Spring context to allow for
access to Spring's facilities. In case of Axis, copy the AxisServlet definition into your 'web.xml', and set up
the endpoint in 'server-config.wsdd' (or use the deploy tool). See the sample application JPetStore where the
OrderService is exposed as a web service using Axis.

我得理解是:只有调用该服务的客户端跟服务器端是跑在同一个上下文中才能使用Spring那一套东西。

真实情况是这样么?如果是那是不是有点太悲剧了,大部分客户端和服务器端还是不在同一个context中的吧?

怎样保证由客户端发起的web service调用能够获取到Spring容器中的Bean呢?
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics