WCF 代理中的 Action 和 ReplyAction

发布于 2024-08-27 20:15:47 字数 51 浏览 4 评论 0原文

OperationContract属性中的Action和ReplyAction有什么用?

What is the use of Action and ReplyAction in OperationContract attribute ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只等公子 2024-09-03 20:15:47

Action 定义服务方法的肥皂操作的输入 uri。

回复操作定义服务方法的输出 uri。

它们基本上用于为两者自定义 uri。见下文。

 [ServiceContract]
 public partial interface IServiceContract
 {
    [OperationContract(
            Action = "http://mynamspace/v1/IServiceContract/Input/ServiceMethod",
            ReplyAction = "http://mynamspace/v1/IServiceContract/Output/ServiceMethod")]
    SomeResponseType ServiceMethod(SomeRequestType x);

在你的 wsdl 中你会看到

 <wsdl:portType name="IServiceContract">
    <wsdl:operation name="ServiceMethod">
    <wsdl:input wsaw:Action="http://mynamspace/v1/IServiceContract/Input/ServiceMethod" name="SomeRequestType" message="tns:SomeRequestType " /> 
    <wsdl:output wsaw:Action="http://mynamspace/v1/IServiceContract/Output/ServiceMethod" name="SomeResponseType" message="tns:SomeResponseType " /> 

这有意义吗?

Action defines your input uri for the soap operation for your service method.

Reply Action defines the output uri for your service method.

They are basically used to customize the uri for both. See below.

 [ServiceContract]
 public partial interface IServiceContract
 {
    [OperationContract(
            Action = "http://mynamspace/v1/IServiceContract/Input/ServiceMethod",
            ReplyAction = "http://mynamspace/v1/IServiceContract/Output/ServiceMethod")]
    SomeResponseType ServiceMethod(SomeRequestType x);

In your wsdl you would see

 <wsdl:portType name="IServiceContract">
    <wsdl:operation name="ServiceMethod">
    <wsdl:input wsaw:Action="http://mynamspace/v1/IServiceContract/Input/ServiceMethod" name="SomeRequestType" message="tns:SomeRequestType " /> 
    <wsdl:output wsaw:Action="http://mynamspace/v1/IServiceContract/Output/ServiceMethod" name="SomeResponseType" message="tns:SomeResponseType " /> 

That make sense?

你列表最软的妹 2024-09-03 20:15:47

它用于 WS 寻址。

WS-Addressing 简介: http://www.fpml.org/_wgmail/_bpwgmail/pdfdz3oYx1M9e .pdf
http://www.w3.org/Submission/ws-addressing/

查看回复soap消息:
http://msdn.microsoft.com/en-us /library/system.servicemodel.operationcontractattribute.action.aspx

Its for WS addressing.

Introduction to WS-Addressing: http://www.fpml.org/_wgmail/_bpwgmail/pdfdz3oYx1M9e.pdf
http://www.w3.org/Submission/ws-addressing/

Look at the reply soap message:
http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.action.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文