HTTP 标头或 SOAP 标头中的 WCF Soap 操作? [英] WCF Soap Actions in HTTP header or SOAP header?

查看:36
本文介绍了HTTP 标头或 SOAP 标头中的 WCF Soap 操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对如何在 WCF(以及与此相关的其他 Web 服务框架)中实现 SOAPAction 感到有些困惑.

I'm a little confused about how SOAPAction is implemented in WCF (and other web service frameworks for that matter).

在测试客户端中,我有一个客户端消息检查器,配置为获取 SOAP 消息和随请求发送的任何 HTTP 标头.至少在客户端消息检查器中,该操作显示为 SOAP 标头中的一个元素:

In a test client, I have a Client Message Inspector configured to grab both the SOAP message and any HTTP headers that are being sent with the request. At least here in the client message inspector, the action shows up as an element in the SOAP Header:

<s:Header>
    <Action ... >http://myurl.com/2009/11/MyService/MyMethod</Action>

但是,如果我在 Fiddler 中查看请求,则缺少 Action 元素,而是现在 HTTP 标头中有一个附加条目:

However, if I view the request in Fiddler, the Action element is missing and instead there is now an additional entry in the HTTP Headers:

SOAPAction: "http://myurl.com/2009/11/MyService/MyMethod"

谁能解释一下这是怎么回事??

Can anyone explain what the heck is going on??

谢谢!

推荐答案

这是 WCF 不符合标准的问题.

This is a problem with WCF not following the standards.

SOAP 1.1 使用 SOAPAction 头来决定调用什么方法,但这有点混乱,因为方法名称嵌入在消息的其他地方.SOAP 1.2 解决了这个问题并将操作添加到 content-type 标头,并弃用了 SOAPAction 标头(尽管它现在对于那些仍然想要发送它的客户端来说是可选的).

SOAP 1.1 uses the SOAPAction header to decide what method to call, but this was a bit messy as the method name was embedded elsewhere in the message. SOAP 1.2 resolved this and added the action to content-type header, and deprecated the SOAPAction header (though its now an optional for those clients that still want to send it).

查看 o'reilly 博客页面了解详情.

See an o'reilly blog page for some details.

这篇关于HTTP 标头或 SOAP 标头中的 WCF Soap 操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆