Index: fedd/fedd_proj.py
===================================================================
--- fedd/fedd_proj.py	(revision 2d58549d34831aa3ddc707d728cfa6ce69830cb9)
+++ fedd/fedd_proj.py	(revision 5b8b8864f39dee75bc15cf65708784567103d038)
@@ -118,9 +118,9 @@
     def get_users(self, obj):
 	"""
-	Return a list of the IDs of the users in dict
+	Return a list of the IDs of the users in obj 
 	"""
 	if obj.has_key('user'):
 	    return [ unpack_id(u['userID']) \
-		    for u in obj['user'] if u.has_key('userID') ]
+		    for u in obj['user'] if u.has_key('userID')]
 	else:
 	    return None
@@ -245,17 +245,11 @@
 	# Reconstruct the full request message
 	msg = RequestAccessRequestMessage()
-	msg.set_element_RequestAccessRequestBody(
-		pack_soap(msg, "RequestAccessRequestBody", req))
+	msg.set_element_RequestAccessRequestBody(req)
+
 	try:
 	    resp = port.RequestAccess(msg)
 	except ZSI.FaultException, e:
 	    raise e.fault
-
-	r = unpack_soap(resp)
-
-	if r.has_key('RequestAccessResponseBody'):
-	    return r['RequestAccessResponseBody']
-	else:
-	    raise Fault(Fault.Server, "Bad proxy response")
+	return resp
 
     def permute_wildcards(self, a, p):
@@ -315,6 +309,5 @@
 	if req.has_key('project'):
 	    p = req['project']
-	    if p.has_key('name'):
-		project = unpack_id(p['name'])
+	    project = unpack_id(p['name'])
 	    user = self.get_users(p)
 	else:
@@ -373,5 +366,5 @@
 	return found, (dyn_user, dyn_proj)
 
-    def build_response(self, alloc_id, ap, ssh):
+    def build_response(self, resp, alloc_id, ap, ssh):
 	"""
 	Create the SOAP response.
@@ -405,43 +398,32 @@
 		[ { 'attribute': x, 'value' : y } \
 			for x,y in self.attrs.iteritems()]
-	return msg
-
+
+	resp.set_element_RequestAccessResponseBody(
+		pack_soap(resp, "RequestAccessResponseBody", msg))
 
     def soap_RequestAccess(self, ps, fid):
 	req = ps.Parse(RequestAccessRequestMessage.typecode)
 
-
-	#if req == None: raise Fault(Fault.Client, "No request??")
-	#req = req.get_element_RequestAccessRequestBody()
-	# if req == None: raise Fault(Fault.Client, "No request body??")
-
-	msg = self.RequestAccess(unpack_soap(req), fedid)
-	resp = RequestAccessResponseMessage()
-
-	resp.set_element_RequestAccessResponseBody(
-		pack_soap(resp, "RequestAccessResponseBody", msg))
-	return resp
-
-    def RequestAccess(self, req, fid):
-
-	if req.has_key('RequestAccessRequestBody'):
-	    req = req['RequestAccessRequestBody']
-	else:
-	    raise Fault(Fault.Client, "No request!?")
-
-	if req.has_key('destinationTestbed'):
-	    dt = unpack_id(req['destinationTestbed'])
+	if req == None: raise Fault(Fault.Client, "No request??")
+	req = req.get_element_RequestAccessRequestBody()
+	if req == None: raise Fault(Fault.Client, "No request body??")
+
+
+	dt = req.get_element_destinationTestbed()
+
+	if dt != None: dt = dt.get_element_uri()
 	
-	print dt
-
 	if dt == None or dt == self.testbed:
-	    # Request for this fedd
-	    found, dyn = self.lookup_access(req, fid)
+	    # Request for this fedd (shift to dictionary representation)
+	    r = unpack_soap(req)
+
+	    found, dyn = self.lookup_access(r, fid)
 
 	    # Check for access to restricted nodes
-	    if req.has_key('resources') and req['resources'].has_key('node'):
-		resources = req['resources']
-		inaccessible = [ t for n in resources['node'] \
-				if n.has_key('hardware') != None \
+	    if r.has_key('resources') and r['resources'].has_key('node'):
+
+		resources = r['resources']
+		inaccessible = [ t for n in resources['node']\
+				if n.has_key('hardware') \
 				    for t in n['hardware'] \
 					if t in self.restricted and \
@@ -453,5 +435,5 @@
 
 	    ssh = [ x['sshPubkey'] \
-		    for x in req['access'] if x.has_key('sshPubkey')]
+		    for x in r['access'] if x.has_key('sshPubkey')]
 
 	    if len(ssh) > 0: 
@@ -461,9 +443,11 @@
 		raise Fault(Fault.Client, "SSH access parameters required")
 
-	    resp = self.build_response(req['allocID'], found, ssh)
+	    resp = RequestAccessResponseMessage()
+	    self.build_response(resp, r['allocID'], found, ssh)
 	    return resp
 	else:
 	    # Proxy the request
 	    return self.proxy_request(dt, req)
+
 
     def read_trust(self, trust):
