Discussion:
Unable to download list of phones/users using SOAP
Russell Fox
2012-10-19 06:36:16 UTC
Permalink
I'm trying to get a list of phones (users too) using SOAP, but get no
records returned even though I use the exact serialnumber that I added the
record with.



I've tried this against version 4.4 and 4.6 (originally thought it was a
problem on 4.4). The code adds the record successfully (I've checked via the
web site) but fails to retrieve it back again. I've also tried with an empty
value in search.bySerialNumber and by setting the group and searching on
that.



I'd prefer to be doing these calls via REST services, but couldn't find the
relevant documentation for Phones and Users for REST.



Any help appreciated greatly.
George Niculae
2012-10-19 07:38:10 UTC
Permalink
I’m trying to get a list of phones (users too) using SOAP, but get no
records returned even though I use the exact serialnumber that I added the
record with.
Hm, I just double checked on a 4.4 machine using SoapUI and I cannot
get response back either, I am looking into and will come back
I’ve tried this against version 4.4 and 4.6 (originally thought it was a
problem on 4.4). The code adds the record successfully (I’ve checked via the
web site) but fails to retrieve it back again. I’ve also tried with an empty
value in search.bySerialNumber and by setting the group and searching on
that.
I’d prefer to be doing these calls via REST services, but couldn’t find the
relevant documentation for Phones and Users for REST.
Unfortunately there is no REST API at this moment for this (though it
should be pretty easy to add)

George
George Niculae
2012-10-22 11:54:45 UTC
Permalink
Post by George Niculae
I’m trying to get a list of phones (users too) using SOAP, but get no
records returned even though I use the exact serialnumber that I added the
record with.
Hm, I just double checked on a 4.4 machine using SoapUI and I cannot
get response back either, I am looking into and will come back
Well it turned out it's only the new version of SoapUI that somehow
removed digest authentication. I tried the old one (3.5.1) and it
worked without issue, sample of request / response for querying phones
and users, could you check your requests to see if they match (also
added the headers used):

POST http://192.168.0.80/sipxconfig/services/PhoneService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Content-Length: 386
Authorization: Digest username="superadmin", realm="ezuce.ro",
nonce="MTM1MDkwNjg0MjcxNjo2NDMwYWI3MGUyNmI0OTdhOTZjYjAzZWJmYWU3YTk4Ng==",
uri="/sipxconfig/services/PhoneService",
response="42dba10a89763ddd20d50ee3f07fa332", qop=auth, nc=00000001,
cnonce="957142670103a1eca733431449be5579"
Host: 192.168.0.80
Cookie: $Version=0; JSESSIONID=2nq97gnbuqoe3; $Path=/sipxconfig

request:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:con="http://www.sipfoundry.org/2007/08/21/ConfigService">
<soapenv:Header/>
<soapenv:Body>
<con:FindPhone>
<search>
<!--Optional:-->
<bySerialNumber>0004f22dc547</bySerialNumber>
</search>
</con:FindPhone>
</soapenv:Body>
</soapenv:Envelope>


response:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<FindPhoneResponse
xmlns="http://www.sipfoundry.org/2007/08/21/ConfigService">
<phones xmlns="">
<user>
<serialNumber>0004f22dc547</serialNumber>
<modelId>polycom335</modelId>
<description>sadasdsa</description>
<lines>
<userId>201</userId>
<uri>"Baba Bubu"&lt;sip:***@ezuce.ro></uri>
</lines>
<deviceVersion>polycom2.0</deviceVersion>
</user>
</phones>
</FindPhoneResponse>
</soapenv:Body>
</soapenv:Envelope>

for users:

request:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:con="http://www.sipfoundry.org/2007/08/21/ConfigService">
<soapenv:Header/>
<soapenv:Body>
<con:FindUser>
<search>
<!--Optional:-->
<byUserName>superadmin</byUserName>
</search>
</con:FindUser>
</soapenv:Body>
</soapenv:Envelope>

response:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<FindUserResponse
xmlns="http://www.sipfoundry.org/2007/08/21/ConfigService">
<users xmlns="">
<user>
<userName>superadmin</userName>
<pintoken>11111111</pintoken>
<lastName xsi:nil="true"/>
<firstName xsi:nil="true"/>
<sipPassword>VtRohrXeV7g7</sipPassword>
<emailAddress xsi:nil="true"/>
<groups>administrators</groups>
<permissions>FreeswitchVoicemailServer</permissions>
<permissions>InternationalDialing</permissions>
<permissions>LocalDialing</permissions>
<permissions>LongDistanceDialing</permissions>
<permissions>Mobile</permissions>
<permissions>TollFree</permissions>
<permissions>Voicemail</permissions>
<permissions>music-on-hold</permissions>
<permissions>personal-auto-attendant</permissions>
<permissions>subscribe-to-presence</permissions>
<permissions>superadmin</permissions>
<branchName xsi:nil="true"/>
</user>
</users>
</FindUserResponse>
</soapenv:Body>
</soapenv:Envelope>

Loading...