Salesforce中的SOAP安全性 [英] SOAP security in Salesforce

查看:202
本文介绍了Salesforce中的SOAP安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图更改当前看起来像这样的Web服务调用标头的wsdl2apex代码:



< Security xmlns =http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd>

< UsernameToken Id = UsernameToken-4>

<用户名> test< /用户名>

< Password>测试< / Password>

< / UsernameToken>

< / Security>

< / env:Header>



像这样:


< soapenv:Header>

< wsse:Security xmlns:wsse =http://docs.oasis -open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">

< wsse:UsernameToken wsu:Id =UsernameToken-4xmlns: wsu =http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd>

< wsse:Username>测试< / wsse:用户名>

< wsse:Password Type =http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText>测试< / wsse:密码> ;

< / wsse:UsernameToken>

< / wsse:安全>

< / soapenv:Header>



一个问题是,我无法弄清楚如何更改元素的名称空间(或者即使它们的名称很重要)。第二个问题是将Type属性放到Password元素上。



任何可以提供任何可能有用的信息吗?



感谢

解决方案

可能对所有人都不可能,但我们设法通过使用XSLT来转换SOAP来解决问题进入了我们想要的SOAP。

I am trying to change the wsdl2apex code for a web service call header that currently looks like this:
<env:Header>
<Security xmlns="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<UsernameToken Id="UsernameToken-4">
<Username>test</Username>
<Password>test</Password>
</UsernameToken>
</Security>
</env:Header>

to look like this:
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-4" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>Test</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Test</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

One problem is that I can't work out how to change the namespaces for elements (or even if it matters what name they have). A secondary problem is putting the Type attribute onto the Password element.

Can any provide any information that might help?

Thanks

解决方案

Might not be possible for everyone, but we managed to solve the problem by using XSLT to transform the SOAP we had into the SOAP we wanted.

这篇关于Salesforce中的SOAP安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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