Administration XML Developer Forums

« Back to Administration XML Questions

Associating device profile to a end user

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hello, I am new to the forum, I have successfully added a device profile, however I am not able to associate it to an existing user. Any sample java code or steps to perform this task would be very much  appreciated.

If you use wsdl and java, here is how I do it:
private static void updateUser(String userid,String dn, String profilename)
{



UpdateUserReq updateUserReq= new UpdateUserReq();
UpdateUserReqPrimaryExtension primaryExtension=new UpdateUserReqPrimaryExtension();
primaryExtension.setPattern(dn);
primaryExtension.setRoutePartitionName("PT-System");
updateUserReq.setPrimaryExtension(primaryExtension);
UpdateUserReqPhoneProfiles phoneProfiles=new UpdateUserReqPhoneProfiles();
String[] profileName=new String[1];
profileName[0]=profilename;
phoneProfiles.setProfileName(profileName);
updateUserReq.setPhoneProfiles(phoneProfiles);
updateUserReq.setUserid(userid);


try {

StandardResponse r = stub.updateUser(updateUserReq);
System.out.println ("Result: " + r.get_return());

} catch (Exception err) {
System.out.println("Fault: "+err.getMessage());


}
}

Hello. Thanks very much for the code, it worked, saved us lots of time. Best regards.