def _send_soap_request(location, upnp_schema, control_path, soap_fn, soap_message):
 headers = {'SOAPAction': '"urn:schemas-upnp-org:service:{schema}:1#{fn_name}"'.format(schema=upnp_schema, fn_name=soap_fn), 'Content-Type': 'text/xml'}
 logging.debug('Sending UPnP request to {0}:{1}...'.format(location.hostname, location.port))
 conn = httplib.HTTPConnection(location.hostname, location.port)
 conn.request('POST', control_path, soap_message, headers)
 response = conn.getresponse()
 conn.close()
 return _parse_for_errors(response)

def _send_soap_request ( location , upnp_schema , control_path , soap_fn , soap_message ) : headers = { 'SOAPAction' : '"urn:schemas-upnp-org:service:{schema}:1#{fn_name}"' . format ( schema = upnp_schema , fn_name = soap_fn ) , 'Content-Type' : 'text/xml' } logging . debug ( 'Sending UPnP request to {0}:{1}...' . format ( location . hostname , location . port ) ) conn = httplib . HTTPConnection ( location . hostname , location . port ) conn . request ( 'POST' , control_path , soap_message , headers ) response = conn . getresponse ( ) conn . close ( ) return _parse_for_errors ( response )
send out soap request to upnp device and return a response .