首页 > 解决方案 > 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。在该元素中,添加了元素UsernamePassword,分别包含客户端的用户名和密码。处理程序类必须在 SOAP 处理程序 XML 文件中声明,并且服务类使用@Handlerchain. 注释必须包含引用的文件属性handler-chain.xml

信息在 https://www.brreg.no/produkter-og-tjenester/bestille-produkter/maskinlesbare-data-enhetsregisteret/full-tilgang-enhetsregisteret/teknisk-dokumentasjon-for-maskinell-tilgang-til-enhetsregisteret/ “历史数据"

标签: rsoap

解决方案


推荐阅读