Zanurkuj w Pythonie/Debugowanie serwisu sieciowego SOAP: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Piotr (dyskusja | edycje)
m Nowa strona: {{Python/Do tłumaczenia}} {{Podświetl|py}} == Debugging SOAP Web Services == The SOAP libraries provide an easy way to see what's going on behind the scenes. Turning on debugging i...
 
Robwolfe (dyskusja | edycje)
Nie podano opisu zmian
Linia 1:
{{WEdycji}}
{{Python/Do tłumaczenia}}
 
{{Podświetl|py}}
== Debugowanie serwisu sieciowego SOAP ==
== Debugging SOAP Web Services ==
 
Biblioteki SOAP dostarczają łatwego sposobu na zobaczenie co się tak naprawdę dzieje za kulisami.
The SOAP libraries provide an easy way to see what's going on behind the scenes.
 
Włączenie debugowania to jest po porstu kwestia ustawienia dwóch flag w konfiguracji <tt>SOAPProxy</tt>.
Turning on debugging is a simple matter of setting two flags in the SOAPProxy's configuration.
 
'''ExamplePrzykład 12.7. DebuggingDebugowanie serwisów SOAP Web Services'''
<nowiki>
>>> from SOAPpy import SOAPProxy
Linia 50:
</nowiki>
 
# Po pierwsze tworzymy normalnie <tt>SOAPProxy</tt> podając URL serwisu i przestrzeń nazw.
# First, create the SOAPProxy like normal, with the service URL and the namespace.
# Second,Po turndrugie onwłączamy debuggingdebugowanie bypoprzez settingustawienie <tt>server.config.dumpSOAPIn</tt> andi <tt>server.config.dumpSOAPOut</tt>.
# Po trzecie wywołujemy jak zwykle zdalną metodę SOAP. Biblioteka SOAP wyświetli zarówno wychodzący dokument XML ządania, jak i przychodzący dokument XML odpowiedzi. To jest cała ciężka praca jaką <tt>SOAPProxy</tt> wykonuje dla Ciebie. Przerażające, nie prawdaż? Rozbieżmy to na czynniki.
# Third, call the remote SOAP method as usual. The SOAP library will print out both the outgoing XML request document, and the incoming XML response document. This is all the hard work that SOAPProxy is doing for you. Intimidating, isn't it? Let's break it down.
 
Większość dokumentu XML żądania, który jest wysyłany do serwera, to są elementy stałe. Zignoruj wszystkie te deklaracje przestrzeni nazw; one nie ulegają zmianie (lub są bardzo podobne) w trakcie wszystkich wywołań SOAP. Sercem "wywołania funkcji" jest ten fragment w elemencie <nowiki><Body></nowiki>:
Most of the XML request document that gets sent to the server is just boilerplate. Ignore all the namespace declarations; they're going to be the same (or similar) for all SOAP calls. The heart of the “function call” is this fragment within the <Body> element:
 
<ns1:getTemp #(1)