Hi All,
I am working on web
application which communicates with Communicator Web Access and Live
communication Server. I can successfully log into LCS system using my web
application.
Problem 1: I am getting xml result from communicator web access
instead of JSON.
I send http web request to
communicator web access server and get back the result using http web response.
I got result into XML instead of JSON.
Code Sample:
requestOutstanding = (HttpWebRequest)WebRequest.Create(m_server + "/cwa/AsyncDataChannel.ashx?AckID="
+ ackID + "&Ck=" +
userCookieRandomName + "&UA=true");
requestOutstanding.Method = "GET";
requestOutstanding.KeepAlive = true;
requestOutstanding.ConnectionGroupName = m_Uri
+ "OutstandingGet";
requestOutstanding.UserAgent = userAgent;
requestOutstanding.Accept =
"text/json";
requestOutstanding.ContentType =
"text/json";
requestOutstanding.CookieContainer =
ccContainer;
// The Actual GET
responseOutstanding=(HttpWebResponse)requestOutstanding.GetResponse();
//responseOutstanding.ContentType =
"text/json";
// Parse the content of response
stream =
responseOutstanding.GetResponseStream();
reader = new StreamReader(stream);
string content = reader.ReadToEnd();
I got following result:
<?xml version="1.0"
encoding="UTF-8" standalone="yes"?>
<div id="sessionUpdateString">
<DIV version="LCW.1"
uri="sip:administrator@lcs.gateway.com" session="15003"
latestUpdate="1">
<DIV type="epid"
value="24-E3-4C-42-B6"></DIV>
<DIV type="policy"
action="update" userNotice="" defaultOrSearch="True"
defaultSearchFields="12" ></DIV>
<DIV type="contact"
action="add" uri="sip:administrator@lcs.gateway.com"
name="AdministratorDisplay" email="admin@lcs.gateway.com"
phone="" iconUri="" note="Administrator here"
oof="" calendarInfo="" presence="Online"
availability="Free" endpointCategory="Web" ></DIV>
<DIV type="contact"
action="add" uri="sip:hardik@lcs.gateway.com"
name="Hardik P. Patel" email="" phone=""
iconUri="" note="" oof=""
calendarInfo="" presence="Online"
availability="Free" endpointCategory="None"
></DIV>
<DIV type="options"
action="untag"
uri="sip:hardik@lcs.gateway.com"></DIV>
<DIV type="group"
action="add" groupId="1"
name="Gateway"></DIV>
<DIV type="group"
action="addContacts" groupId="1" name="Gateway"
contacts="sip:hardik@lcs.gateway.com "></DIV>
<DIV type="group"
action="add" groupId="2"
name="Gateway1"></DIV>
<DIV type="acl"
action="add" acl="allow"
users="sip:hardik@lcs.gateway.com " ></DIV>
</DIV>
</div>
<div id="queryTimeout">3000</div>
So what is the
problem, why am I getting xml output instead of JSON? I also tried Microsoft
sample application comes with Communicator Web Access, which also get XML
output instead of JSON.
Problem 2 is that after some time (approx 2 min) session is closed
automatically. And I got error “<div
id="exception">SessionFailure</div><div
id="exceptionDetails">3</div>”.
Problem 3 is then when I want to start IM with any online user, and
I tried to call "StartIM" method of Communicator web access Ajax, it returns blank
xml. "<xml></xml>". As per the help it returns IMID and
description field. But I am not getting these fields in output.
Can you please tell me why
I am getting blank xml ("<xml></xml>")? These problems
arise in most of all the method (like "ACL", "SetPresence"
etc.)
Please help me.
Thanks,
Regards,
Hardik Patel