Index: fedd/fedd_client.py
===================================================================
--- fedd/fedd_client.py	(revision 03e0290ca3c8437abef1a5c25750bc49f5bea8c5)
+++ fedd/fedd_client.py	(revision 89d95025f0b0d4f158b4799f013db45416e43963)
@@ -99,4 +99,6 @@
 	fedd_client_opts.__init__(self)
 	self.add_option("-e", "--experiment_cert", dest="out_certfile",
+		type="string", help="output certificate file")
+	self.add_option("-E", "--experiment_name", dest="exp_name",
 		type="string", help="output certificate file")
 	self.add_option("-F","--useFedid", action="store_true",
@@ -141,23 +143,4 @@
 		help="Testbed identifier (URI) to contact (required)")
 
-def exit_with_fault(dict, out=sys.stderr):
-    """ Print an error message and exit.
-
-    The dictionary contains the FeddFaultBody elements."""
-    codestr = ""
-
-    if dict.has_key('errstr'):
-	codestr = "Error: %s" % dict['errstr']
-
-    if dict.has_key('code'):
-	if len(codestr) > 0 : 
-	    codestr += " (%d)" % dict['code']
-	else:
-	    codestr = "Error Code: %d" % dict['code']
-
-    print>>out, codestr
-    print>>out, "Description: %s" % dict['desc']
-    sys.exit(dict.get('code', 20))
-
 class fedd_exp_data_opts(fedd_client_opts):
     def __init__(self):
@@ -165,5 +148,25 @@
 	self.add_option("-e", "--experiment_cert", dest="exp_certfile",
 		type="string", help="output certificate file")
-
+	self.add_option("-E", "--experiment_name", dest="exp_name",
+		type="string", help="output certificate file")
+
+def exit_with_fault(dict, out=sys.stderr):
+    """ Print an error message and exit.
+
+    The dictionary contains the FeddFaultBody elements."""
+    codestr = ""
+
+    if dict.has_key('errstr'):
+	codestr = "Error: %s" % dict['errstr']
+
+    if dict.has_key('code'):
+	if len(codestr) > 0 : 
+	    codestr += " (%d)" % dict['code']
+	else:
+	    codestr = "Error Code: %d" % dict['code']
+
+    print>>out, codestr
+    print>>out, "Description: %s" % dict['desc']
+    sys.exit(dict.get('code', 20))
 # Base class that will do a the SOAP/XMLRPC exchange for a request.
 class fedd_rpc:
@@ -171,5 +174,5 @@
 	def __init__(self, fb):
 	    self.desc = fb.get('desc', None)
-	    self.code = fb.get('code', None)
+	    self.code = fb.get('code', -1)
 	    self.errstr = fb.get('errstr', None)
 
@@ -310,5 +313,5 @@
 		method_call = getattr(port, self.method, None)
 		resp = method_call(
-			encapsulate_binaries({ self.RequestBody: msg},\
+			encapsulate_binaries({ self.RequestBody: req_dict},\
 			    ('fedid',)))
 	    except Error, e:
@@ -317,5 +320,6 @@
 	    if resp:
 		if resp.has_key(self.ResponseBody): 
-		    return resp[self.ResponseBody]
+		    return decapsulate_binaries(resp[self.ResponseBody],
+			    ('fedid',))
 		elif resp.has_key('FeddFaultBody'):
 		    raise self.RPCException(resp['FeddFaultBody'])
@@ -387,11 +391,18 @@
 	    sys.exit("Cannot read certificate (%s)" % cert)
 
+	if opts.exp_name and opts.exp_certfile:
+	    sys.exit("Only one of --experiment_cert and " +\
+		    "--experiment_name permitted");
+
 	if opts.exp_certfile:
-	    exp_fedid = fedid(file=opts.exp_certfile)
-	else:
-	    sys.exit("Experiment certfile required")
+	    exp_id = { 'fedid': fedid(file=opts.exp_certfile) }
+
+	if opts.exp_name:
+	    exp_id = { 'localname' : opts.exp_name }
+
+	req = { 'experiment': exp_id }
 
 	try:
-	    resp_dict = self.do_rpc({ 'experiment': { 'fedid': exp_fedid } }, 
+	    resp_dict = self.do_rpc(req,
 		    opts.url, opts.transport, cert, opts.trusted, 
 		    serialize_only=opts.serialize_only,
@@ -401,5 +412,6 @@
 		    {'desc': e.desc, 'errstr': e.errstr, 'code': e.code})
 	except RuntimeError, e:
-	    sys.exit("Error processing RPC: %s" % e.message)
+	    print e
+	    sys.exit("Error processing RPC: %s" % e)
 
 	try:
@@ -469,4 +481,7 @@
 			} ]
 		}
+
+	if opts.exp_name:
+	    msg['experimentID'] = { 'localname': opts.exp_name }
 
 	if opts.debug > 1: print >>sys.stderr, msg
@@ -493,4 +508,10 @@
 	    except IOError:
 		sys.exit('Could not write to %s' %  out_certfile)
+	eid = resp_dict.get('experimentID', None)
+	if eid:
+	    for id in eid:
+		for k in id.keys():
+		    if k == 'fedid': print "%s: %s" % (k,fedid(bits=id[k]))
+		    else: print "%s: %s" % (k, id[k])
 
 class access(fedd_rpc):
