r - R中的SOAP请求,带有WS-security,SOAPHandler
问题描述
我尝试向使用 JAX-WS、WS-security 构建的 SOAP-server 发送请求。我在 R 中使用代码。
c(Accept = "text/xml",
'Content-Type' = "text/xml; charset=utf-8",
SOAPAction = "null")
body = '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<hentBasisdata xmlns="http://no/brreg/saksys/grunndata/ws">
<userid>***</userid>
<password>***</password>
<orgnr>985586632</orgnr>
</hentBasisdata>
</Body>
</Envelope>'
qq<-POST("https://grunndata.brreg.no:443/grunndata/ErFr", body=body)
链接到服务器 https://ws.brreg.no/grunndata-ws/GrunndataService?WSDL
他们说他们使用了 WS-Secuirty,我必须使用SOAPHandler<SOAPMessageContext>
. 在处理程序类中,SOAPHeader
必须使用元素来构建a UsernameToken
。在该元素中,添加了元素Username
和Password
,分别包含客户端的用户名和密码。处理程序类必须在 SOAP 处理程序 XML 文件中声明,并且服务类使用@Handlerchain
. 注释必须包含引用的文件属性handler-chain.xml
。
解决方案
推荐阅读
- php - parse_ini_file 在类中不起作用
- python - 如何划分两个DataFrame
- javascript - 选择一个值用jquery更改另一个选择框值
- macos - ContextErrorException,“继续”定位开关相当于“中断”
- cors - Google 跟踪代码管理器对 API 的跨域请求被阻止
- flutter - 如何修复'另一个异常被抛出:NoSuchMethodError:null 上的无效成员:'findRenderObject''在飞镖与 web 的颤动?
- reactjs - Express 服务器上的 React-Router v4 历史记录
- azure - 使用带有 Postman 的 Azure Rest API 更新逻辑应用重复频率
- c# - 如何在 Azure WebJob 中使用 HostBuilder 将部分配置加载到自定义对象中
- css - 样式的滚动问题