Index: fedd/federation/emulab_access.py
===================================================================
--- fedd/federation/emulab_access.py	(revision d8442da7d69e34476c078dbcbd2c2a735a8dc408)
+++ fedd/federation/emulab_access.py	(revision 2ee4226b9e0583993240989328c6c406b2a06c45)
@@ -172,5 +172,5 @@
 
 	self.call_SetValue = service_caller('SetValue')
-	self.call_GetValue = service_caller('GetValue')
+	self.call_GetValue = service_caller('GetValue', log=self.log)
 
         if not config.has_option("allocate", "uri"):
@@ -1307,5 +1307,4 @@
 	"""
 
-	call_SetValue = service_caller('SetValue', log=self.log)
 	for c in connInfo:
 	    for p in [ p for p in c.get('parameter', []) \
@@ -1321,5 +1320,5 @@
 			self.log.debug("Setting %s to %s on %s" % \
 				(k, value, surl))
-			call_SetValue(surl, req, cf)
+			self.call_SetValue(surl, req, cf)
 		    else:
 			self.log.error("Bad export request: %s" % p)
@@ -1331,5 +1330,5 @@
 			self.log.debug("Setting %s to %s on %s" % \
 				(k, self.ssh_port, surl))
-			call_SetValue(surl, req, cf)
+			self.call_SetValue(surl, req, cf)
 		    else:
 			self.log.error("Bad export request: %s" % p)
@@ -1356,6 +1355,5 @@
 		    self.log.debug("Waiting for %s (%s) from %s" % \
 			    (name, key, store))
-		    call_GetValue = service_caller('GetValue')
-		    r = call_GetValue(store, req, cf)
+		    r = self.call_GetValue(store, req, cf)
 		    r = r.get('GetValueResponseBody', None)
 		    if r :
Index: fedd/federation/remote_service.py
===================================================================
--- fedd/federation/remote_service.py	(revision d8442da7d69e34476c078dbcbd2c2a735a8dc408)
+++ fedd/federation/remote_service.py	(revision 2ee4226b9e0583993240989328c6c406b2a06c45)
@@ -345,9 +345,4 @@
 	# basic string if it isn't one already.
 	r = self.strip_unicode(copy.deepcopy(req))
-	url = str(url)
-	
-	transport = SSL_Transport(ctx)
-	port = ServerProxy(url, transport=transport)
-	# Make the call, and convert faults back to service_errors
 	if self.request_body_name:
 	    r  = self.apply_to_tags(\
@@ -356,4 +351,5 @@
 	    r = self.apply_to_tags(r, self.encap_fedids)
 
+	url = str(url)
 	ok = False
 	retries = 0
@@ -361,4 +357,6 @@
 	while not ok and retries < self.max_retries:
 	    try:
+		transport = SSL_Transport(ctx)
+		port = ServerProxy(url, transport=transport)
 		remote_method = getattr(port, self.service_name, None)
 		resp = remote_method(r)
@@ -405,43 +403,56 @@
 		    "Call to soap service without a configured request body");
 
-	# If a context is given, use it.  Otherwise construct one from
-	# components.  The construction shouldn't call out for passwords.
-	if context:
-	    ctx = context
-	else:
-	    try:
-		ctx = fedd_ssl_context(cert_file, trusted_certs, 
-			password=cert_pwd)
-	    except SSL.SSLError:
-		raise service_error(service_error.server_config,
-			"Certificates misconfigured")
-	loc = self.locator()
-	get_port = getattr(loc, self.port_name, None)
-	if not get_port:
-	    raise service_error(service_error.internal, 
-		    "Cannot get port %s from locator" % self.port_name)
-	port = get_port(url,
-		transport=M2Crypto.httpslib.HTTPSConnection, 
-		transdict={ 'ssl_context' : ctx },
-		tracefile=tf)
-	remote_method = getattr(port, self.service_name, None)
-	if not remote_method:
-	    raise service_error(service_error.internal,
-		    "Cannot get service from SOAP port")
-
-	# Reconstruct the full request message
-	msg = self.request_message()
-	set_element = getattr(msg, "set_element_%s" % self.request_body_name,
-		None)
-	if not set_element:
-	    raise service_error(service_error.internal,
-		    "Cannot get element setting method for %s" % \
-			    self.request_body_name)
-	set_element(self.pack_soap(msg, self.request_body_name, req))
 	ok = False
 	retries = 0
 	while not ok and retries < self.max_retries:
 	    try:
+		# Reconstruct the full request message
+		msg = self.request_message()
+		set_element = getattr(msg, "set_element_%s" % \
+			self.request_body_name,
+			None)
+		if not set_element:
+		    raise service_error(service_error.internal,
+			    "Cannot get element setting method for %s" % \
+				    self.request_body_name)
+		set_element(self.pack_soap(msg, self.request_body_name, req))
+		# If a context is given, use it.  Otherwise construct one from
+		# components.  The construction shouldn't call out for
+		# passwords.
+		if context:
+		    if self.log:
+			self.log.debug("Context passed in to call_soap")
+		    ctx = context
+		else:
+		    if self.log:
+			self.log.debug(
+				"Constructing context in call_soap: %s" % \
+					cert_file)
+		    try:
+			ctx = fedd_ssl_context(cert_file, trusted_certs, 
+				password=cert_pwd)
+		    except SSL.SSLError, e:
+			if self.log:
+			    self.log.debug("Certificate error: %s" % e)
+			raise service_error(service_error.server_config,
+				"Certificates misconfigured")
+		loc = self.locator()
+		get_port = getattr(loc, self.port_name, None)
+		if not get_port:
+		    raise service_error(service_error.internal, 
+			    "Cannot get port %s from locator" % self.port_name)
+		port = get_port(url,
+			transport=M2Crypto.httpslib.HTTPSConnection, 
+			transdict={ 'ssl_context' : ctx },
+			tracefile=tf)
+		remote_method = getattr(port, self.service_name, None)
+		if not remote_method:
+		    raise service_error(service_error.internal,
+			    "Cannot get service from SOAP port")
+
 		fail_exc = None
+		if self.log:
+		    self.log.debug("Calling %s (retry %d)" % \
+			    (self.service_name, retries))
 		resp = remote_method(msg)
 		ok = True
