0

So i am trying to add some policies to the PDP of wso2. I did manage to add policies using this code

 public function addPolicy($policy, $policyId = '')
    {
        $this->soapClient->__soapCall(
            'addPolicy',
            [
                'parameters' => [
                    'policyDTO' => [
                        'policyId' => $policyId,
                        'policy' => $policy
                        ]
                    ]
            ]
        );
    }

Then i want to publish the policy i just added to the PDP using this code

public function publishPolicy($policyId)
    {
        $this->soapClient->__soapCall(
            'publishToPDP',
            [
                'parameters' => [
                    'verificationCode' => $policyId,
                    'enabled' => true,
                    'order' => 1
                ]
            ]
        );
    }

However the policy is not published to PDP. The server seems to receive the request but do nothing. Am i doing something wrong? How should this request be formed?

I have also tried the publishPolicies SoapCall but no luck...

Community
  • 1
  • 1
nickGR
  • 110
  • 4
  • 11

1 Answers1

0

Its seems that the publishToPDP is not really active. What actually worked is using the addPolicy with some additional attributes like promote.

Here is an example of how it worked for me

$this->soapClient->__soapCall(
            'addPolicy',
            [
                'parameters' => [
                    'policyDTO' => [
                        'policyId' => $policyId,
                        'policy' => $policy,
                        'version' => $version,
                        'policyOrder' => $policyOrder,
                        'active' =>  true,
                        'promote' => true
                        ]
                    ]
            ]
        );

Using these attributes the policy is added and is published to PDP.

nickGR
  • 110
  • 4
  • 11