#NEWLINE# def parseRequest( soap_data ) : #NEWLINE# #INDENT# ( headers , bodies ) = minisoap . parseSoapPayload ( soap_data ) #NEWLINE# if ( headers is None ) : #NEWLINE# #INDENT# raise ValueError ( 'No header specified in payload' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( headers ) > 1 ) : #NEWLINE# #INDENT# raise ValueError ( 'Multiple headers specified in payload' ) #NEWLINE# #UNINDENT# #UNINDENT# header = nsiframework . parseElement ( headers [ 0 ] ) #NEWLINE# security_attributes = [ ] #NEWLINE# if header . sessionSecurityAttr : #NEWLINE# #INDENT# for ssa in header . sessionSecurityAttr : #NEWLINE# #INDENT# for attr in ssa . Attributes : #NEWLINE# #INDENT# for av in attr . AttributeValue : #NEWLINE# #INDENT# if ( av is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# security_attributes . append ( nsa . SecurityAttribute ( attr . Name , b ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( len ( bodies ) == 0 ) : #NEWLINE# #INDENT# body = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( bodies ) == 1 ) : #NEWLINE# #INDENT# body = nsiconnection . parseElement ( bodies [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# body = [ nsiconnection . parseElement ( b ) for b in bodies ] #NEWLINE# #UNINDENT# #UNINDENT# nsi_header = nsa . NSIHeader ( header . requesterNSA , header . providerNSA , header . correlationId , header . replyTo , security_attributes = security_attributes , connection_trace = header . connectionTrace ) #NEWLINE# return ( nsi_header , body )