<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Extension Mobility Query...</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1942046" />
  <subtitle>Extension Mobility Query...</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1942046</id>
  <updated>2013-05-18T15:28:43Z</updated>
  <dc:date>2013-05-18T15:28:43Z</dc:date>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2768652" />
    <author>
      <name>Sascha Monteiro</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2768652</id>
    <updated>2010-11-23T02:49:07Z</updated>
    <published>2010-11-23T02:49:07Z</published>
    <summary type="html">cool, I couldn't find the  "Content-Type: application/x-www-form-urlencoded" in the API doco, very odd that this is used...
I had to run wireshark to trace the message from the EMApi example to see the header..
a REST service would have been nice, like CUPI, Cisco introduced too many different webservices ;-)</summary>
    <dc:creator>Sascha Monteiro</dc:creator>
    <dc:date>2010-11-23T02:49:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2570624" />
    <author>
      <name>Axel Schemberg</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2570624</id>
    <updated>2010-09-24T15:47:32Z</updated>
    <published>2010-09-24T15:47:32Z</published>
    <summary type="html">Hi Dan,
 
I think I found "your" fault ... it isn't really yours, it is more to the developer or those who write the documentation.
1. Although you might think we are talking XML, no, we don't. That means no xml header like &lt;?xml version=1.0&gt; etc. Just use simple string.
2. urlencode the xml based em api call "urlencode("&lt;query&gt;...some content ...&lt;/query&gt;");"
3. prepend an xml= (not urlencode!) to encoded xml (see step 2).
4. use HTTP header "Content-Type: application/x-www-form-urlencoded"
 
that should work. In your example you miss step 3 I think.
 
Kind reagards
 
Axel</summary>
    <dc:creator>Axel Schemberg</dc:creator>
    <dc:date>2010-09-24T15:47:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2542059" />
    <author>
      <name>Axel Schemberg</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2542059</id>
    <updated>2010-09-16T15:35:48Z</updated>
    <published>2010-09-16T15:35:48Z</published>
    <summary type="html">Hi Dan,
 
I ran into the same problem with CUCM 6.1.2 (on VMWare too).
While my C# doesn't work a simple HTML works.
 
Did you find any solution?
 
Kind regards
 
Axel</summary>
    <dc:creator>Axel Schemberg</dc:creator>
    <dc:date>2010-09-16T15:35:48Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2036202" />
    <author>
      <name>dan dan</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2036202</id>
    <updated>2010-03-12T21:35:00Z</updated>
    <published>2010-03-12T21:35:00Z</published>
    <summary type="html">may you say how to work this services on IP phones??
userid ,machine id e.g values how to take??</summary>
    <dc:creator>dan dan</dc:creator>
    <dc:date>2010-03-12T21:35:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1946450" />
    <author>
      <name>dan turner</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1946450</id>
    <updated>2010-02-04T16:55:17Z</updated>
    <published>2010-02-04T16:55:17Z</published>
    <summary type="html">Sorry Michael, I meant to say thanks for the suggestion too!!!
 
this forum seems awfully quiet so I wasn't really expecting a response.
 
Dan</summary>
    <dc:creator>dan turner</dc:creator>
    <dc:date>2010-02-04T16:55:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1946445" />
    <author>
      <name>dan turner</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1946445</id>
    <updated>2010-02-04T16:52:18Z</updated>
    <published>2010-02-04T16:52:18Z</published>
    <summary type="html">very odd...
 
there must be multiple causes for this then!!!
 
i only have a publisher.. its a vmware test machine...
 
anyhoo i think it was my headers...
 
In case anyone is curious I got it working with this:
 

   ExtQuery = "xml=&lt;query&gt;";
                ExtQuery += "&lt;appInfo&gt; &lt;appID&gt;admin&lt;/appID&gt; &lt;appCertificate&gt;p1tBas!c&lt;/appCertificate&gt; &lt;/appInfo&gt;";
                ExtQuery += "&lt;userDevicesQuery&gt; &lt;userID&gt;"+UserID+"&lt;/userID&gt; &lt;/userDevicesQuery&gt;";
                ExtQuery += "&lt;/query&gt;";

 

       HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://x.x.x.x:8080/emservice/EMServiceServlet");
 
            req.Accept = "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
            req.ContentType = "application/x-www-form-urlencoded";
            req.Method = "POST";
            req.KeepAlive = true;
 
            Stream s = req.GetRequestStream();
            s.Write(System.Text.Encoding.ASCII.GetBytes(ExtQuery), 0, ExtQuery.Length);
            s.Close();
            WebResponse resp = req.GetResponse();
            StreamReader sr = new StreamReader(resp.GetResponseStream());
            string XMLResult = sr.ReadToEnd();</summary>
    <dc:creator>dan turner</dc:creator>
    <dc:date>2010-02-04T16:52:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1944064" />
    <author>
      <name>Michel Shuqair</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1944064</id>
    <updated>2010-02-03T17:59:09Z</updated>
    <published>2010-02-03T17:59:09Z</published>
    <summary type="html">Hi,
 
I've seen this error before. For us the solution was to enable Extension Mobility on BOTH publisher and subscriber. If it was enabled for only one of them it gave http 500 error.
 
Hope this helps.
 
 </summary>
    <dc:creator>Michel Shuqair</dc:creator>
    <dc:date>2010-02-03T17:59:09Z</dc:date>
  </entry>
  <entry>
    <title>Extension Mobility Query...</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1942045" />
    <author>
      <name>dan turner</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1942045</id>
    <updated>2010-02-02T21:35:56Z</updated>
    <published>2010-02-02T21:35:56Z</published>
    <summary type="html"> 
Hey guys, 

I'm just trying to execute a query using EMAPI...
 
heres the Code...
 
      		ExtQuery = "&lt;query&gt;/n";
                ExtQuery += "&lt;appInfo&gt; /n";
                ExtQuery += "&lt;appID&gt;admin&lt;/appID&gt; /n";
                ExtQuery += "&lt;appCertificate&gt;p1tBas!c&lt;/appCertificate&gt; /n";
                ExtQuery += "&lt;/appInfo&gt; /n";
                ExtQuery += "&lt;userDevicesQuery&gt; /n";
                ExtQuery += "&lt;userID&gt;" + UserID + "&lt;/userID&gt; /n";
                ExtQuery += "&lt;/userDevicesQuery&gt; &lt;/query&gt;/n";        
 

 
   HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://192.168.200.15/emservice/EMServiceServlet");
 

   req.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
            req.ContentType = "application/x-www-form-urlencoded";
            req.Method = "POST";
            req.KeepAlive = true; 
 
            Stream s = req.GetRequestStream();
            s.Write(System.Text.Encoding.ASCII.GetBytes(ExtQuery), 0, ExtQuery.Length);
            s.Close();
            WebResponse resp = req.GetResponse();
            StreamReader sr = new StreamReader(resp.GetResponseStream());
            string XMLResult = sr.ReadToEnd();
 
Im getting an Error 500 Internal server error...
 
does anyone have any suggestions? if i browse to the URL i also get an error 500 page.
 
Dan


 </summary>
    <dc:creator>dan turner</dc:creator>
    <dc:date>2010-02-02T21:35:56Z</dc:date>
  </entry>
</feed>

