Handle SOAP error on undefined response properly.

Handle undefined response and SOAP error separately.
Simplify debug output (no need for sprintf).