- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我了解如何向 SOAP 请求添加 header 。但这会生成一个与我需要传递的不匹配的 header 。返回此 header :
<SOAP-ENV:Header>
<wsse:Security mustUnderstand="true">
<wsse:UsernameToken>
<wsse:Username>CABLE</wsse:Username>
<wsse:Password>CABLE</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>
但是,我需要修改该 header 的命名空间,以便为 Security 对象和 UsernameToken 对象传递特定的命名空间。我似乎无法弄清楚如何覆盖提供的默认值。
<soapenv:Header>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
http://schemas.xmlsoap.org/ws/2002/07/secext
<wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<wsse:Username>CABLE</wsse:Username>
<wsse:Password Type="wsse:PasswordText">CABLE</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
这是生成上述内容的 Python 代码
security = Security()
token = UsernameToken('CABLE', 'CABLE')
security.tokens.append(token)
client.set_options(wsse=security)
最佳答案
想通了。这是答案。只需要使用 ns 参数
def createWSSecurityHeader(username,password):
# Namespaces
wsse = ('wsse', 'http://schemas.xmlsoap.org/ws/2002/07/secext')
# Create Security Element
security = Element('Security', ns=wsse)
# Create UsernameToken, Username/Pass Element
usernametoken = Element('UsernameToken', ns=wsse)
uname = Element('Username', ns=wsse).setText(username)
passwd = Element('Password', ns=wsse).setText(password)
# Add Username and Password elements to UsernameToken element
usernametoken.insert(uname)
usernametoken.insert(passwd)
security.insert(usernametoken)
return security
关于python - 将命名空间添加到 Suds 中的默认 WSSE 安全对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7168293/
我们可以通过添加 key 存储、传出 WS-安全配置(时间戳、用户名和签名)以及用户 token 、时间戳主体的命名空间来从 SOAP UI 工具调用 Web 服务,然后应用传出 wss -> 应用“
我目前正在研究 WSSE 协议(protocol)以保护我的 api。 我已经理解了基础,并且头脑清晰。 但是我遇到了一个问题。 假设我想生成一个一次性摘要,我必须连接时间戳、随机数和 secret
我正尝试按照 symfony 说明书 Symfony Link 给出的步骤使用 wsse 创建身份验证提供程序.但是我遇到了一个我一直试图解决的意外错误(已经 3 天了)。 这是我的错误: Inval
我正在使用 IBM JAX-RPC/JAX-WS 创建 Web 服务。我正在尝试实现 wsse 安全性,但无法找出实现相同目标的确切步骤。我将为此 Web 服务使用 RSA 7.5 和 Websphe
我正在使用CXF 3.1.5,尝试将请求发送到STS服务器,即STS strong>服务器有一个策略,相关部分如下 因此,在发送到 STS 服务器的请求 CXF 中,签名 ke
我最近一直在为 WSS 服务编写客户端。它根据其文档使用 usernametoken 配置文件。我已经写了这样的东西作为代码来传达它。但是由于不允许匿名身份验证,我总是面临服务未经授权的错误。 我该如
我正在尝试使用 wcf 通过相互证书进行 SOAP 调用,但还是不断出错 “请求已中止:无法创建 SSL/TLS 安全通道。”或 '远程服务器返回错误:(500) 内部服务器错误缺少 wsse: 请求
我们目前正在重新开发一个遗留项目,该项目使用 Lumesse 的 SOAP 网络服务,通过 HTTPS 调用。 http://developer.lumesse.com/Getting_Started
我了解如何向 SOAP 请求添加 header 。但这会生成一个与我需要传递的不匹配的 header 。返回此 header : CA
我几乎没有使用 SOAP 协议(protocol)的经验。我需要连接到所需 header 的服务。我认为这在 Java 中有点标准,但在 C# 中必须手动创建此 header 。 这里有没有人能够连接
我想将 wsse:security 添加到我的 soap 消息中。这是我的代码: public Document signSoapMessage(SOAPMessage message) {
我在生成 gSOAP 安全 header (WSSE) 时遇到问题。我已经编译了所有必要的文件并使用以下调用将 WSSE 安全 header 添加到请求中: soap_wsse_add_Securit
我构建了一个基于 CXF 的 SOAP Web 服务,并尝试按照本教程的步骤使用 WS-Security 添加一些安全方面的内容。 我收到处理 header 时发现错误 以下是向 SOAP 添加安全方
我需要从 Wix.com 平台上的 Node 服务器与soap:xml API 进行通信。该 API 需要 Soap WSSE 身份验证。 我可以向 SoapUI 中的端点发送经过身份验证的请求,但未
我正在关注 custom authentication provider Symfony 2 的说明书,但我不知道如何生成登录表单或具有正确所需的 WSSE header 的东西,所以我可以将其传递给
我正在尝试通过相应的 wsdl 使用 Web 服务。此服务依赖于符合 Web Services Security Basic Security Profile 1.0 的身份验证包括 http://d
免责声明:.Net N00b 几天来,我一直在用头撞墙,试图让这个外部供应商网络服务的安全工作无济于事。事实证明,他们使用 WSSE 摘要安全性,简而言之,它向 SOAP header 添加了如下内容
当尝试使用 SoapClient 实现 Web 服务时,似乎没有解析 wsdl 链接;尝试创建新的 SoapClient 对象时,请求失败并显示消息: Request failed. Reason:
我需要连接的 Web 服务具有上述要求。我可以在 VS 2008 中使用此 Web 服务,但无法使用它,因为我不知道如何进行身份验证。我需要指定 credentails,但是没有公开“header”方
按照此 http://symfony.com/doc/current/security/custom_authentication_provider.html 结果是 Service "securit
我是一名优秀的程序员,十分优秀!