spring.net 发布 webservice的一点心得

为了支持高级应用场景,如将AOP代理暴露为Web服务,Spring.NET要求待发布的对象需实现特定接口。仅接口方法会被导出为Web服务方法。注意不要在实现的接口中包含对以接口形式声明的对象成员的访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

首先引用 spring-net-reference文档中的话

Interface Requirements

In order to support some advanced usage scenarios, such as the ability to expose an AOP proxy as
a web service (allowing the addition of AOP advices to web service methods), Spring.NET requires
those objects that need to be exported as web services to implement a (service) interface.
Web Services
Spring Framework (Version 1.3.2) 310

Only methods that belong to an interface will be exported by the WebServiceExporter.


这段话的意思是用 spring.net 发布成webservice的类必须实现某个接口,spring.net 会自动把这个接口的函数公布成webservice函数。

因为spring.net的大量使用面向接口的编程,而接口是不能序列化的,所以用接口声明的成员对象导致类不能发布成webservice,那么就要注意这些用接口形式声明的成员对象访问器不能包含在类所实现的接口中!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱知菜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值