Closed crawc closed 3 years ago
This works for me.
$request = (new GroupAccessDeviceModifyRequest14()) ->setserviceProviderId($serviceProviderId) ->setgroupId($groupId) ->setdeviceName($deviceName) ->setuseCustomUserNamePassword($useCustomUserNamePassword) ->setaccessDeviceCredentials ( (new DeviceManagementUserNamePassword16()) ->setuserName($credentials) ->setpassword($credentials));
Thank you!
It looks like I had some brackets that were causing it not to work correctly. This is now working. The same works with both GroupAccessDeviceModifyRequest14
and GroupAccessDeviceModifyRequest22
without issue.
$setCreds = (new GroupAccessDeviceModifyRequest22())
->setserviceProviderId("LAB_Enterprise")
->setGroupId("LAB_1")
->setDeviceName("testPhone")
->setUseCustomUserNamePassword(true)
->setAccessDeviceCredentials(
(new DeviceManagementUserNamePassword16())
->setUserName("testDeviceUsername")
->setPassword("testDevicePassword")
);
try {
$resultsCreds = $ocip->GroupAccessDeviceModifyRequest22($setCreds);
print_r($resultsCreds);
} catch (ErrorResponseException $e) {
echo 'Server Error: ' . $e->getMessage() . PHP_EOL;
exit();
} catch (ValidationException $e) {
echo 'Validation Error: ' . $e->getMessage() . PHP_EOL;
exit();
}
no problem did you know you can get the result like $response = $ocip->call($request);
No, but thanks for the tip, got any other ;)?
Do you know if there is any way to get the currently GET the AccessDeviceCredentials?
got loads!!! you can only get the UserName from the GroupAccessDeviceGetResponse, for the password guess you could read the device xml template file which i do to get passwords.
To get the currently set device password are you saying to check the configurationFileName
or repositoryUrl
XML files on the AS or PS servers directly or from the OCI API?
We are trying to not have to set a new device password if possible. This is for a zero-touch provisioning server.
hi Check the device template file on the ps
Hello, I checked and it looks to be the template file, I need the device username and password to download the repository file via the XSP server.
yes you will, is it a standard login same for all device. send me your email if easier to chat
Got it
On Wed, 21 Jul 2021, 17:53 crawc, @.***> wrote:
Sure its: crawsol AT gmail.com
Let me know once you have it so I can remove this. Thanks again!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cwmiller/broadworks-connector/issues/64#issuecomment-884340074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2EPS4TW27B5C6VK26PUETTY33SDANCNFSM5AUE7ZDA .
Closing issue.
I'm not sure if this is an issue or if I'm just doing this completely wrong but after trying everything I could think of I decided to post this with my fingers crossed. I'm trying to use the GroupAccessDeviceModifyRequest22 request to set a given device's username and password.
Thank you for any assistance that can be provided.
Here is the code: $setCreds = (new GroupAccessDeviceModifyRequest22()) ->setServiceProviderId("LAB_Enterprise") ->setGroupId("LAB_1") ->setDeviceName("testPhone") ->setUseCustomUserNamePassword(true) ->setAccessDeviceCredentials([ (new DeviceManagementUserNamePassword16()) ->setUserName("testDeviceUsername") ->setPassword("testDevicePassword") ]);
Here is the error:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to CWM\BroadWorksConnector\Ocip\Models\GroupAccessDeviceModifyRequest22::setAccessDeviceCredentials() must be an instance of CWM\BroadWorksConnector\Ocip\Models\DeviceManagementUserNamePassword16 or null, array given