<?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: Python and AXL API, Error: 502 Tunnel Connection Failed in Management</title>
    <link>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4056797#M3362</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;There could be many reasons for 502 errors like, server might not be reachable from the client, or it might not be able to resolve the server address(FQDN) and so on.&lt;/P&gt;
&lt;P&gt;I could find the below link, hope that would give you some ideas in troubleshooting your problem,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/118079-troubleshoot-wsa-00.html" target="_blank"&gt;https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/118079-troubleshoot-wsa-00.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2020 14:04:47 GMT</pubDate>
    <dc:creator>Anusha B R</dc:creator>
    <dc:date>2020-04-01T14:04:47Z</dc:date>
    <item>
      <title>Python and AXL API, Error: 502 Tunnel Connection Failed</title>
      <link>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4055204#M3355</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;I am developing with Python and AXL API, i&lt;/SPAN&gt;&lt;/SPAN&gt; have trouble connection to CUCM AXL API Call Manager the issue is: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;# -*- coding: utf-8 -*-
from zeep import Client
from zeep.cache import SqliteCache
from zeep.transports import Transport
from zeep.exceptions import Fault
from zeep.plugins import HistoryPlugin
from requests import Session
from requests.auth import HTTPBasicAuth
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
from lxml import etree
 
disable_warnings(InsecureRequestWarning)
 
username = 'admon'
password = 'ciscopsdt'
# If you're not disabling SSL verification, host should be the FQDN of the server rather than IP
host = '10.10.20.1'
 
#wsdl = 'file://C:/Development/Resources/axlsqltoolkit/schema/current/AXLAPI.wsdl'
wsdl = 'file://C:/Users/HIBARRAR/Documents/SoftM/Cisco DevNet/API CUCM Call Manager/axlsqltoolkit/schema/11.5/AXLAPI.wsdl'
location = 'https://{host}:8443/axl/'.format(host = host)
binding = "{http://www.cisco.com/AXLAPIService/}AXLAPIBinding"
 
# Create a custom session to disable Certificate verification.
# In production you shouldn't do this, 
# but for testing it saves having to have the certificate in the trusted store.
session = Session()
session.verify = False
session.auth = HTTPBasicAuth(username, password)
 
transport = Transport(cache = SqliteCache(), session = session, timeout = 20)
history = HistoryPlugin()
client = Client(wsdl = wsdl, transport = transport, plugins = [history])
service = client.create_service(binding, location)
 
def show_history():
    for item in [history.last_sent, history.last_received]:
        print(etree.tostring(item["envelope"], encoding="unicode", pretty_print=True))

try:
    resp = service.listPhone(searchCriteria={'name': '%'}, 
                             returnedTags={'name': '', 'description': ''})
    print(resp)
except Fault:
    show_history()&lt;/PRE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;PRE&gt;HTTPSConnectionPool(host='XXX.XXX.XXX.XXX, port=8443): &lt;BR /&gt;Max retries exceeded with url: &lt;STRONG&gt;/axl/&lt;/STRONG&gt; &lt;BR /&gt;(Caused by ProxyError('Cannot connect to proxy.', &lt;BR /&gt;OSError('Tunnel connection failed: &lt;STRONG&gt;502 Tunnel Connection Failed&lt;/STRONG&gt;')))&lt;/PRE&gt;&lt;DIV&gt;Anyone, can help me?&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Mar 2020 22:16:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4055204#M3355</guid>
      <dc:creator>HomeroIbarra39561</dc:creator>
      <dc:date>2020-03-30T22:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python and AXL API, Error: 502 Tunnel Connection Failed</title>
      <link>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4056797#M3362</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;There could be many reasons for 502 errors like, server might not be reachable from the client, or it might not be able to resolve the server address(FQDN) and so on.&lt;/P&gt;
&lt;P&gt;I could find the below link, hope that would give you some ideas in troubleshooting your problem,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/118079-troubleshoot-wsa-00.html" target="_blank"&gt;https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/118079-troubleshoot-wsa-00.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 14:04:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4056797#M3362</guid>
      <dc:creator>Anusha B R</dc:creator>
      <dc:date>2020-04-01T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python and AXL API, Error: 502 Tunnel Connection Failed</title>
      <link>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4060362#M3368</link>
      <description>&lt;P&gt;Trying your code above just now on my PC, seems to work...perhaps something in the environment..?:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Ubuntu 19.10&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Python 3.7.5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Python libraries:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;appdirs==1.4.3&lt;BR /&gt;attrs==19.3.0&lt;BR /&gt;cached-property==1.5.1&lt;BR /&gt;certifi==2020.4.5.1&lt;BR /&gt;chardet==3.0.4&lt;BR /&gt;defusedxml==0.6.0&lt;BR /&gt;idna==2.9&lt;BR /&gt;isodate==0.6.0&lt;BR /&gt;lxml==4.5.0&lt;BR /&gt;pkg-resources==0.0.0&lt;BR /&gt;pytz==2019.3&lt;BR /&gt;requests==2.23.0&lt;BR /&gt;requests-toolbelt==0.9.1&lt;BR /&gt;six==1.14.0&lt;BR /&gt;urllib3==1.25.8&lt;BR /&gt;zeep==3.4.0&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 20:52:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-and-axl-api-error-502-tunnel-connection-failed/m-p/4060362#M3368</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2020-04-06T20:52:44Z</dc:date>
    </item>
  </channel>
</rss>

