on 01-24-2014 05:19 PM
Hi,
I have integrated the webex api code in asp.net for creating meeting but it is giving me Failure Message : "Failed to get siteUrl" . The exception Id is 010000.
Below is my code
<?xml version="1.0" encoding="utf-8" ?>
<serv:message xmlns:serv="http://www.webex.com/schemas/2002/06/service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.webex.com/schemas/2002/06/service http://www.webex.com/schemas/2002/06/service/service.xsd">
<header>
<securitycontext>
<siteName>apidemoeu</siteName>
<webExID>abc@xyz.com</webExID>
<password>xxxxx</password>
<siteID>yyyyyy</siteID>
<partnerID>zzzzz</partnerID>
</securitycontext>
</header>
<body>
<bodycontent xsi:type="java:com.webex.service.binding.meeting.CreateMeeting">
<accesscontrol>
</accesscontrol>
<metadata>
<confname>Sample Meeting</confname>
<!--<meetingtype>1</meetingType>-->
<agenda>Test</agenda>
</metadata>
<participants>
<maxusernumber>4</maxusernumber>
<attendees>
<attendee>
<person>
<name>abc</name>
<email>pqr@xyz.com</email>
</person>
</attendee>
</attendees>
</participants>
<schedule>
<startdate>2014-03-15</startdate>
<opentime>900</opentime>
<!--<jointeleconfbeforehost>true</joinTeleconfBeforeHost>-->
<duration>20</duration>
<timezoneid>42</timezoneid>
<!-- Colombo Time Zone Id=42-->
</schedule>
<!--<telephony>
<telephonysupport>CALLIN</telephonySupport>
<exttelephonydescription>
Call 1-800-555-1234, Passcode 98765
</extTelephonyDescription>
</telephony>-->
</bodycontent>
</body>
</serv:message>
protected void btnCreate_Click(object sender, EventArgs e)
{
WebResponse response = null;
Stream dataStream = null;
try
{
string confName = "Sample Meeting";
//Get Emails separated by commas
string[] emails = attendeeList.Split(',');
//Create New Meeting and reload page
//string strXMLServer = @"https://go.webex.com/WBXService/XMLService";
string strXMLServer = @"https://apidemoeu.webex.com/WBXService/XMLService";
WebRequest request = WebRequest.Create(strXMLServer);
// Set the Method property of the request to POST.
request.Method = "POST";
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
UTF8Encoding encoding = new UTF8Encoding();
XmlDocument xmlDocument = new XmlDocument();
try
{
XmlReader reader = new XmlTextReader(Server.MapPath("xml/CreateMeeting.xml"));
xmlDocument.Load(reader);
}
catch (Exception)
{
throw;
}
//XmlNamespaceManager manager = new XmlNamespaceManager(xmlDocument.NameTable);
//manager.AddNamespace("serv", "http://www.webex.com/schemas/2002/06/service");
////Set Meeting metadata
//xmlDocument.SelectSingleNode("/serv:message/body/bodycontent/metadata/confname", manager).InnerText = confName;
//xmlDocument.SelectSingleNode("/serv:message/body/bodycontent/schedule/startdate", manager).InnerText = DateTime.Now.ToString();
////Set Attendees
//XmlNode attendeeListNode = xmlDocument.SelectSingleNode("/serv:message/body/bodycontent/participants/attendees", manager);
//if (attendeeListNode != null)
//{
// foreach (string email in emails)
// {
// try
// {
// XmlNode attendeeNode = xmlDocument.CreateNode(XmlNodeType.Element, "attendee", "");
// attendeeNode.InnerXml = "<person><name>" + email.Split('@')[0] + "</name><email>" + email.Trim() + "</email></person>";
// attendeeListNode.AppendChild(attendeeNode);
// }
// catch (Exception)
// {
// throw new Exception("Please insert valid email addresses");
// }
// }
//}
byte[] byteArray = Encoding.UTF8.GetBytes(xmlDocument.OuterXml);
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
request.GetRequestStream().Write(byteArray, 0, byteArray.Length);
// Write the data to the request stream.
//dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
// Get the response.
response = request.GetResponse();
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream();
XmlDocument xmlReply = null;
//if (response.ContentType == "application/xml" || response.ContentType == "text/xml;charset=UTF-8")
//{
xmlReply = new XmlDocument();
xmlReply.Load(dataStream);
//}
//Process Meeting Response
string result = this.ProcessMeetingResponse(xmlReply);
if (!string.IsNullOrEmpty(result))
{
lblMessage.Text = result;
}
}
Kindly suggest a solution.
Thanks,
Krupa
Hi Krupa,
The error "Failed to get siteUrl" means the API info in the securityContext (siteName, siteID, partnerID) don't match for the WebEx site you are POSTing your XML request to. If you are POSTing to https://apidemoeu.webex.com/WBXService/XMLService, please make sure the siteID and partnerID are the ones associated with apidemoeu.webex.com.
Regards,
Jayde
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: