Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

Reply
Contributor
Posts: 11
Registered: ‎07-29-2013
My Device: BlackBerry 10
My Carrier: Verizon
Accepted Solution

Having trouble assigning a user with SetUsersActivationPasswordRequest

I'm writing this in VB.NET, I'm passing a user object to the SetUsersActivationPasswordRequest.  When stepping through the code I see that the user is being passed, however the example code assigns a user using the following statement (note: example code is in c#) 

 

request.getUsers().add(user);
 

When I attempt this line of code, getUsers() is actually "users" and there is not a ".add" option under users(). 


How exactly am I supposed to assign a user to this function?  Is passing the entire object ok?

 

Below is a copy of my code:

   

PrivateFunction BB10SetActivationPassword(ByVal user As Object, ByVal pwd As String) As Boolean

       

Dim returnValue As Boolean = False

       

Dim request As BWSService.SetUsersActivationPasswordRequest = New BWSService.SetUsersActivationPasswordRequest()

        request.metadata = METADATA

        request.activationPassword = pwd

        request.users = user

       

Dim mt As BWSService.MessageType = New BWSService.MessageType

        mt.EMAIL = True

       

'request.sendActivationMessageUsingMessageType = mt

       

Dim response As BWSService.SetUsersActivationPasswordResponse = Nothing

       

Try

            response = bwsService.setUsersActivationPassword(request)

       

Catch ex As Exception

       

End Try

       

If (response.returnStatus.code.Equals("SUCCESS")) Then

           

If Not (response.individualResponses Is Nothing) Then

               

For Each individualResponse In response.individualResponses

                   

'// log success for creation {0} & {1}

               

Next

                returnValue =

True

           

EndIf

       

Else

           

If No (response.individualResponses Is Nothing) Then

               

For Each individualResponse In response.individualResponses

                   

'//log response codes

               

Next

 

               

Next

           

EndIf

       

EndIf

       

Return returnValue

   

EndFunction

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Having trouble assigning a user with SetUsersActivationPasswordRequest

Contributor
Posts: 11
Registered: ‎07-29-2013
My Device: BlackBerry 10
My Carrier: Verizon

Re: Having trouble assigning a user with SetUsersActivationPasswordRequest

I'm not sure that actually answers my issue.  I have one user that I am passing.  stored in an object called "user".  When I try it the way you suggested in the link you provided I get a too many arguements error:  Am I supposed to be passing the entire object to the request.users property?

 

 

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Having trouble assigning a user with SetUsersActivationPasswordRequest

Yes, you're supposed to add the entire user. Could you post the new code snippet being used? Please use code blocks to help with readability.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
Posts: 11
Registered: ‎07-29-2013
My Device: BlackBerry 10
My Carrier: Verizon

Re: Having trouble assigning a user with SetUsersActivationPasswordRequest

Hi Garett,

 

I'm sorry, that actually did help, just as you indicated in your example.  We can close this issue.

 

Thanks

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Having trouble assigning a user with SetUsersActivationPasswordRequest

Awesome! Glad to hear Smiley Happy

Garett
@garettBeuk
--
Goodbye everybody!