如何配置我的 Spring.net Webservice 成员属性?
我正在尝试设置一个类似于以下网址示例的 Spring.net Web 服务:
http://www.springframework.net/doc-latest/reference/html/springair.html
我对服务操作的成员属性有一些疑问。以下 xml 设置将属性注入到操作中:
<property name="MemberAttributes">
<dictionary>
<entry key="SuggestFlights">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Gets those flight suggestions that are applicable for the supplied trip."/>
</object>
</entry>
<entry key="Book">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Goes ahead and actually books what up until this point has been a transient reservation."/>
</object>
</entry>
<entry key="GetAirportList">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Return a collection of all those airports that can be used for the purposes of booking."/>
</object>
</entry>
</dictionary>
</property>
我对此有两个问题。首先,是否可以在 AopAlliance.Intercept 拦截器中访问这些属性的值?例如,是否可以从拦截器内访问 WebMethod 属性的 Description 属性的值?可能在 Invoke 方法及其 IMethodIn Vocation 参数内。
其次,是否可以添加从 System.Attribute 派生的自定义属性(类似于上面概述的 Web 方法属性),并再次访问拦截器中属性的属性。
对上述任何帮助都会很棒!
I am trying to setup a Spring.net web-service similar to the example at the following url:
http://www.springframework.net/doc-latest/reference/html/springair.html
I have some questions regarding the member attributes on the service operations. The following xml setup injects in the attributes to the operations:
<property name="MemberAttributes">
<dictionary>
<entry key="SuggestFlights">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Gets those flight suggestions that are applicable for the supplied trip."/>
</object>
</entry>
<entry key="Book">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Goes ahead and actually books what up until this point has been a transient reservation."/>
</object>
</entry>
<entry key="GetAirportList">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Return a collection of all those airports that can be used for the purposes of booking."/>
</object>
</entry>
</dictionary>
</property>
I have 2 questions around this. Firstly is it possible to access values from these attributes within AopAlliance.Intercept Interceptors? For example, is it possible to access the value of the Description property of the WebMethod Attribute, from within an interceptor? Possibly within the Invoke method and its IMethodInvocation parametter.
Secondly, is it possible to add custom attributes, derived from System.Attribute, similar to web method attributes outlined above and again access the properties of the attribute within an interceptor.
Any help on the above would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论