def _from_soap(in_envelope_xml, xmlids=None, **kwargs):
 ns_soap = kwargs.pop('ns', ns.soap11_env)
 if xmlids:
  resolve_hrefs(in_envelope_xml, xmlids)
 if (in_envelope_xml.tag != ('{%s}Envelope' % ns_soap)):
  raise Fault('Client.SoapError', ('No {%s}Envelope element was found!' % ns_soap))
 header_envelope = in_envelope_xml.xpath('e:Header', namespaces={'e': ns_soap})
 body_envelope = in_envelope_xml.xpath('e:Body', namespaces={'e': ns_soap})
 if ((len(header_envelope) == 0) and (len(body_envelope) == 0)):
  raise Fault('Client.SoapError', 'Soap envelope is empty!')
 header = None
 if (len(header_envelope) > 0):
  header = header_envelope[0].getchildren()
 body = None
 if ((len(body_envelope) > 0) and (len(body_envelope[0]) > 0)):
  body = body_envelope[0][0]
 return (header, body)

def _from_soap ( in_envelope_xml , xmlids = None , ** kwargs ) : ns_soap = kwargs . pop ( 'ns' , ns . soap11_env ) if xmlids : resolve_hrefs ( in_envelope_xml , xmlids ) if ( in_envelope_xml . tag != ( '{%s}Envelope' % ns_soap ) ) : raise Fault ( 'Client.SoapError' , ( 'No {%s}Envelope element was found!' % ns_soap ) ) header_envelope = in_envelope_xml . xpath ( 'e:Header' , namespaces = { 'e' : ns_soap } ) body_envelope = in_envelope_xml . xpath ( 'e:Body' , namespaces = { 'e' : ns_soap } ) if ( ( len ( header_envelope ) == 0 ) and ( len ( body_envelope ) == 0 ) ) : raise Fault ( 'Client.SoapError' , 'Soap envelope is empty!' ) header = None if ( len ( header_envelope ) > 0 ) : header = header_envelope [ 0 ] . getchildren ( ) body = None if ( ( len ( body_envelope ) > 0 ) and ( len ( body_envelope [ 0 ] ) > 0 ) ) : body = body_envelope [ 0 ] [ 0 ] return ( header , body )
parses the xml string into the header and payload .