<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Connection refused when connecting to RisPort70 service in Management</title>
    <link>https://community.cisco.com/t5/management/connection-refused-when-connecting-to-risport70-service/m-p/4589164#M3872</link>
    <description>&lt;P&gt;I believe in some versions of CUCM, the Risport70 WSDL includes the actual CUCM hostname in the WSDL contents, but in some it provides a generic one, i.e. localhost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should work with any version is to specifically set the target hostname when creating the Risport70 service, similar to what you are already doing with AXL (which always provides a generic hostname in the WSDL:)&lt;/P&gt;&lt;PRE&gt;axl_service = axl_client.create_service(axl_binding, &lt;STRONG&gt;axl_location&lt;/STRONG&gt;)&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Apr 2022 15:11:14 GMT</pubDate>
    <dc:creator>dstaudt</dc:creator>
    <dc:date>2022-04-08T15:11:14Z</dc:date>
    <item>
      <title>Connection refused when connecting to RisPort70 service</title>
      <link>https://community.cisco.com/t5/management/connection-refused-when-connecting-to-risport70-service/m-p/4588594#M3871</link>
      <description>&lt;P&gt;I was trying to query the status of cisco phones status in the following python script. But received following errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /realtimeservice2/services/RISService70 (Caused by NewConnectionError('&amp;lt;urllib3.connection.HTTPSConnection object at 0x110685460&amp;gt;: Failed to establish a new connection: [Errno 61] Connection refused'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Common Plugins&lt;BR /&gt;history = HistoryPlugin()&lt;/P&gt;&lt;P&gt;# Build Client Object for AXL Service&lt;BR /&gt;axl_wsdl = 'schema/AXLAPI.wsdl'&lt;BR /&gt;axl_location = f'https://{server}:8443/axl/'&lt;BR /&gt;axl_binding = '{&lt;A href="http://www.cisco.com/AXLAPIService/}AXLAPIBinding" target="_blank" rel="noopener"&gt;http://www.cisco.com/AXLAPIService/}AXLAPIBinding&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;axl_session = Session()&lt;BR /&gt;axl_session.verify = False&lt;BR /&gt;axl_session.auth = HTTPBasicAuth(username, password)&lt;/P&gt;&lt;P&gt;axl_transport = Transport(cache=SqliteCache(), session=axl_session,&lt;BR /&gt;timeout=20)&lt;BR /&gt;axl_client = Client(wsdl=axl_wsdl, transport=axl_transport,&lt;BR /&gt;plugins=[history])&lt;BR /&gt;axl_service = axl_client.create_service(axl_binding, axl_location)&lt;/P&gt;&lt;P&gt;# Build Client Object for RisPort70 Service&lt;/P&gt;&lt;P&gt;wsdl = f'https://{server}:8443/realtimeservice2/services/RISService70?wsdl'&lt;/P&gt;&lt;P&gt;session = Session()&lt;BR /&gt;session.verify = False&lt;BR /&gt;session.auth = HTTPBasicAuth(username, password)&lt;/P&gt;&lt;P&gt;transport = Transport(cache=SqliteCache(), session=session, timeout=20)&lt;BR /&gt;client = Client(wsdl=wsdl, transport=transport, plugins=[history])&lt;/P&gt;&lt;P&gt;def show_history():&lt;BR /&gt;for hist in [history.last_sent, history.last_received]:&lt;BR /&gt;print(etree.tostring(hist["envelope"],&lt;BR /&gt;encoding="unicode",&lt;BR /&gt;pretty_print=True))&lt;/P&gt;&lt;P&gt;# Get List of Phones to query via AXL&lt;BR /&gt;# (required when using SelectCmDeviceExt)&lt;BR /&gt;try:&lt;BR /&gt;resp = axl_service.listPhone(searchCriteria={'name': 'ATA%'},&lt;BR /&gt;returnedTags={'name': ''})&lt;BR /&gt;except Fault:&lt;BR /&gt;show_history()&lt;BR /&gt;raise&lt;/P&gt;&lt;P&gt;# Build item list for RisPort70 SelectCmDeviceExt&lt;BR /&gt;items = []&lt;BR /&gt;for phone in resp['return'].phone:&lt;BR /&gt;items.append(phone.name)&lt;/P&gt;&lt;P&gt;print(items)&lt;BR /&gt;print("len = ", len(items))&lt;/P&gt;&lt;P&gt;if len(items) &amp;gt; 1000:&lt;BR /&gt;print("This demo app only supports under 1000 results")&lt;BR /&gt;print("Exiting...")&lt;BR /&gt;sys.exit()&lt;/P&gt;&lt;P&gt;# Run SelectCmDeviceExt&lt;BR /&gt;CmSelectionCriteria = {&lt;BR /&gt;'MaxReturnedDevices': '1000',&lt;BR /&gt;'DeviceClass': 'Phone',&lt;BR /&gt;'Model': '255',&lt;BR /&gt;'Status': 'Any',&lt;BR /&gt;'NodeName': '',&lt;BR /&gt;'SelectBy': 'Name',&lt;BR /&gt;'SelectItems': {&lt;BR /&gt;'item': items&lt;BR /&gt;},&lt;BR /&gt;'Protocol': 'Any',&lt;BR /&gt;'DownloadStatus': 'Any'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;StateInfo = ''&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;resp = client.service.selectCmDeviceExt(&lt;BR /&gt;CmSelectionCriteria=CmSelectionCriteria,&lt;BR /&gt;StateInfo=StateInfo)&lt;BR /&gt;except Fault:&lt;BR /&gt;show_history()&lt;BR /&gt;raise&lt;/P&gt;&lt;P&gt;snapshot = {}&lt;/P&gt;&lt;P&gt;CmNodes = resp.SelectCmDeviceResult.CmNodes.item&lt;BR /&gt;for CmNode in CmNodes:&lt;BR /&gt;if len(CmNode.CmDevices.item) &amp;gt; 0:&lt;BR /&gt;# If the node has returned CmDevices, save to the snapshot to&lt;BR /&gt;# later compare&lt;BR /&gt;for item in CmNode.CmDevices.item:&lt;BR /&gt;# Creates a new list if the key in the dictionary isn't yet&lt;BR /&gt;# assigned or simply appends to the entry if there is already&lt;BR /&gt;# a value present&lt;BR /&gt;snapshot.setdefault(CmNode.Name,&lt;BR /&gt;[]).append({'Name': item.Name,&lt;BR /&gt;'Status': item.Status})&lt;/P&gt;&lt;P&gt;print("Successfully captured current Risport status.")&lt;/P&gt;&lt;P&gt;while True:&lt;BR /&gt;print("Press Enter to query Risport and compare to the initial result")&lt;BR /&gt;print("or Ctrl+C to exit")&lt;BR /&gt;input("...")&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;resp = client.service.selectCmDeviceExt(&lt;BR /&gt;CmSelectionCriteria=CmSelectionCriteria,&lt;BR /&gt;StateInfo=StateInfo)&lt;BR /&gt;except Fault:&lt;BR /&gt;show_history()&lt;BR /&gt;raise&lt;/P&gt;&lt;P&gt;no_change = True&lt;BR /&gt;CmNodes = resp.SelectCmDeviceResult.CmNodes.item&lt;BR /&gt;for CmNode in CmNodes:&lt;BR /&gt;# Skip the CmNode if it doesn't contain any entries&lt;BR /&gt;if len(CmNode.CmDevices.item) &amp;gt; 0:&lt;BR /&gt;# Loop through all the returned items and compare the status&lt;BR /&gt;# to that of the snapshot&lt;BR /&gt;for item in CmNode.CmDevices.item:&lt;BR /&gt;for snapshot_item in snapshot[CmNode.Name]:&lt;BR /&gt;if snapshot_item['Name'] == item.Name and snapshot_item['Status'] != item.Status:&lt;BR /&gt;print(f"{item.Name} changed status from {snapshot_item['Status']} to {item.Status}")&lt;BR /&gt;no_change = False&lt;/P&gt;&lt;P&gt;if no_change:&lt;BR /&gt;print("No difference between snapshot and most recent query detected")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 20:08:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/connection-refused-when-connecting-to-risport70-service/m-p/4588594#M3871</guid>
      <dc:creator>Young2020</dc:creator>
      <dc:date>2022-04-07T20:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Connection refused when connecting to RisPort70 service</title>
      <link>https://community.cisco.com/t5/management/connection-refused-when-connecting-to-risport70-service/m-p/4589164#M3872</link>
      <description>&lt;P&gt;I believe in some versions of CUCM, the Risport70 WSDL includes the actual CUCM hostname in the WSDL contents, but in some it provides a generic one, i.e. localhost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should work with any version is to specifically set the target hostname when creating the Risport70 service, similar to what you are already doing with AXL (which always provides a generic hostname in the WSDL:)&lt;/P&gt;&lt;PRE&gt;axl_service = axl_client.create_service(axl_binding, &lt;STRONG&gt;axl_location&lt;/STRONG&gt;)&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Apr 2022 15:11:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/connection-refused-when-connecting-to-risport70-service/m-p/4589164#M3872</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2022-04-08T15:11:14Z</dc:date>
    </item>
  </channel>
</rss>

