ok, also ich hab jetzt mal ein bisschen "geforscht".
also auf ein nachträgliches setzen der auth
Code: Alles auswählen
binding.setAuth(AUTH.httpbasic, "myUsername", "bigsecret")
hat keinerlei auswirkungen. da kommt dann sowas raus:
Code: Alles auswählen
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header></SOAP-ENV:Header>
<SOAP-ENV:Body>
<setAuth SOAP-ENC:arrayType="xsd:anyType[3]" xsi:type="SOAP-ENC:Array">
<element id="o965b30" xsi:type="xsd:int">1</element>
<element id="o1c95820" xsi:type="xsd:string">myUsername</element>
<element id="o1c95840" xsi:type="xsd:string">bigsecret</element>
</setAuth>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ein im constuctor von binding mitgebenes auth (ACHTUNG: nur mit Patch, dazu siehe weiter unten in diesem Beitrag)
Code: Alles auswählen
kw.setdefault("auth", (AUTH.httpbasic, "myUsername", "bigsecret"))
self.binding = client.Binding(url="http://serviceurl", **kw)
dagegen schon. da kommt dann sowas raus:
Code: Alles auswählen
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<ZSI:BasicAuth>
<ZSI:Name>myUsername</ZSI:Name>
<ZSI:Password>bigsecret</ZSI:Password>
</ZSI:BasicAuth>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:ns1="http://www.datapower.com/schemas/management">
<ns1:request></ns1:request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
tja, was schliessen wir daraus....nicht immer alles glauben was in der doku steht.
was mir noch aufgefallen ist (zumindest auf meinem system):
im client.py wird der header in Send() folgendermaßen gesetzt
Code: Alles auswählen
# Determine the SOAP auth element. SOAP:Header element
if self.auth_style & AUTH.zsibasic:
sw.serialize_header(_AuthHeader(self.auth_user, self.auth_pass),
_AuthHeader.typecode)
self.auth_style und AUTH.zsibasic sind 1 und 2. die abfrage
ist trotzdem false. wenn ich das jetzt in
ändere, ist sie (korrekt) true.
Warum ist das so? Ist das Kompiler bedingt oder so?