Monday, May 19, 2008

Creating a CWA client with Silverlight 2 beta1 (part 3)

In Part 2 we created the logon request and send it. We got our CWA-ticket(authentication ticket) back. We will need this for all future request.
Now let’s do something with the response.


The method above will be used for all synchronous request. In this sample for logging in, creating a session. And for all commands we send to the cwa server.

When we login we get the Uri(our sip address) back belonging to the authentication information we used to login. And we get our signInData back. We need this for Initiating our session.
The other 2 things I handle in processing the response are the SID (session ID) we get that back from after initiating our session. And the PollWaitTime, this I will address in part 4.
Now we are authenticated next step is to set up a session.


This looks pretty the same as login in, but it uses a different request and a different url to send the request to. We need to add some code to the things we did in Part 2.
First the url we add to our UserAgent class.


Next is adding functionality to our Request builder. And to our constants.


So now we have setup our session. Next is to let our main application know that we successfully created the session. As you can see I raise an event in our UserAgent class. Our main Silverlight can handle that event. Hiding the login textboxes. Intializing our main UI.
What do we need for raising that event.


Now we have our session. We know how to send commands to the server. Next is checking for events from the server. Which we want to do asynchronously. That is going to be Part 4 of this series.

Any questions/ comments please feel free to contact us. or or or

No comments:

working at e-office