【问题标题】:publishToPDP. Exception while sending SOAP request发布到PDP。发送 SOAP 请求时出现异常
【发布时间】:2017-07-01 12:31:03
【问题描述】:

我已成功将策略添加到 PAP。

我现在尝试使用 SOAP 接口将其发布到 PDP。 这是我的请求,但我收到 500 错误“尝试调用服务方法 publishToPDP 时发生异常” 我刚刚设置了最小参数,因为版本、顺序和操作是可选的。

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd">
   <soap:Header/>
   <soap:Body>
      <xsd:publishToPDP>
         <!--Zero or more repetitions:-->
         <xsd:policyIds>policy-3</xsd:policyIds>
      </xsd:publishToPDP>
   </soap:Body>
</soap:Envelope>

我尝试过使用和不使用“”。同样的错误。

有人可以帮我吗? 非常感谢您的支持

问候

vpl

【问题讨论】:

    标签: wso2is


    【解决方案1】:

    我在 wsoo2 上打开了 HTTP 端口并运行了客户端 java 示例 http://xacmlinfo.org/2013/09/27/xacml-policy-administration/ 通过使用 Wireshark 嗅探网络跟踪,我能够检索到我正在寻找的 SOAP 请求。 对于 PublishToPDP,这里是有效的请求

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
       <soapenv:Body>
          <ns3:publishToPDP xmlns:ns3="http://org.apache.axis2/xsd">
             <ns3:policyIds>policy-3</ns3:policyIds>
             <ns3:version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
             <ns3:action>CREATE</ns3:action>
             <ns3:order>0</ns3:order>
          </ns3:publishToPDP>
       </soapenv:Body>
    </soapenv:Envelope>
    

    我怀疑操作和/或命令不像界面中描述的那么可选......

    问候 Vpl

    【讨论】:

      【解决方案2】:

      你应该像这样设置 API 的所有元素:

      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd">
         <soap:Header/>
         <soap:Body>
            <xsd:publishToPDP>
               <xsd:policyIds>policy_1</xsd:policyIds>
               <xsd:action>PUBLISH_POLICY</xsd:action>
               <xsd:version>1</xsd:version>
               <xsd:enabled>true</xsd:enabled>
               <xsd:order>0</xsd:order>
            </xsd:publishToPDP>
         </soap:Body>
      </soap:Envelope>
      
      then it should return :
      
      <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
         <soapenv:Body>
            <ns:publishToPDPResponse xmlns:ns="http://org.apache.axis2/xsd">
               <ns:return xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            </ns:publishToPDPResponse>
         </soapenv:Body>
      </soapenv:Envelope>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-07-15
        • 1970-01-01
        • 1970-01-01
        • 2023-01-11
        • 1970-01-01
        • 2018-05-25
        • 2019-10-08
        相关资源
        最近更新 更多