Index: lib/dataone-service-api-0.1.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib/dataone-service-api-0.1.0.jar
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: lib/dataone-service-api-0.3.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib/dataone-service-api-0.3.0.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: lib/jibx-run-1.2.2.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib/jibx-run-1.2.2.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java	(revision 5319)
+++ src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java	(revision 5320)
@@ -22,10 +22,6 @@
  */
 package edu.ucsb.nceas.metacat.restservice;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -54,9 +50,12 @@
 import org.dataone.service.exceptions.ServiceFailure;
 import org.dataone.service.exceptions.UnsupportedType;
 import org.dataone.service.types.AuthToken;
-import org.dataone.service.types.IdentifierType;
+import org.dataone.service.types.Identifier;
 import org.dataone.service.types.SystemMetadata;
-import org.exolab.castor.jdo.conf.DataSource;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
 
 import edu.ucsb.nceas.metacat.DBUtil;
 import edu.ucsb.nceas.metacat.IdentifierManager;
@@ -470,7 +469,9 @@
         OutputStream out = null;
         try {
             out = response.getOutputStream();
-            InputStream data = cs.get(token, new IdentifierType(guid));
+            Identifier id = new Identifier();
+            id.setValue(guid);
+            InputStream data = cs.get(token, id);
             IOUtils.copyLarge(data, response.getOutputStream());
         } catch (BaseException e) {
                 serializeException(e, out);
@@ -604,19 +605,21 @@
                     }
                 }
 
+                // TODO: access control!
                 //if (username != null && !username.equals("public")) {
                 if (username != null) {
 
                     logMetacat.debug("Commence creation...");
                     AuthToken token = null;
-                    SystemMetadata m = new SystemMetadata(sysmeta);
-                    logMetacat.debug(m.serialize(SystemMetadata.FMT_XML));
-                    //IOUtils.copy(object, System.out);
-//                    byte[] b = new byte[2048];
-//                    int len = object.read(b);
-//                    logMetacat.debug("Read " + len + " bytes from object: " + new String(b));
+                    IBindingFactory bfact =
+                        BindingDirectory.getFactory(SystemMetadata.class);
+                    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+                    SystemMetadata m = (SystemMetadata) uctx.unmarshalDocument(sysmeta, null);
+
                     CrudService cs = new CrudService(servletContext, request, response);
-                    cs.create(token, new IdentifierType(guid), object, m);
+                    Identifier id = new Identifier();
+                    id.setValue(guid);
+                    cs.create(token, id, object, m);
 
                 } else {
                     logMetacat.debug("Unauthorized to create.");
@@ -649,6 +652,10 @@
         } catch (IOException e) {
             ServiceFailure sf = new ServiceFailure(1000, e.getMessage());
             serializeException(sf, out);
+        } catch (JiBXException e) {
+            e.printStackTrace(System.out);
+            InvalidSystemMetadata ism = new InvalidSystemMetadata(1080, e.getMessage());
+            serializeException(ism, out);
         }
     }
 
Index: src/edu/ucsb/nceas/metacat/dataone/CrudService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5319)
+++ src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5320)
@@ -54,7 +54,7 @@
 import org.dataone.service.types.AuthToken;
 import org.dataone.service.types.Checksum;
 import org.dataone.service.types.DescribeResponse;
-import org.dataone.service.types.IdentifierType;
+import org.dataone.service.types.Identifier;
 import org.dataone.service.types.LogRecordSet;
 import org.dataone.service.types.SystemMetadata;
 
@@ -173,7 +173,7 @@
         return sessionData;
     }
     
-    public IdentifierType create(AuthToken token, IdentifierType guid, 
+    public Identifier create(AuthToken token, Identifier guid, 
             InputStream object, SystemMetadata sysmeta) throws InvalidToken, 
             ServiceFailure, NotAuthorized, IdentifierNotUnique, UnsupportedType, 
             InsufficientResources, InvalidSystemMetadata, NotImplemented {
@@ -185,7 +185,7 @@
         String[] groups = null;
 
         // verify that guid == SystemMetadata.getIdentifier()
-        logMetacat.debug("Comparing guid|sysmeta_guid: " + guid.getIdentifier() + "|" + sysmeta.getIdentifier().getIdentifier());
+        logMetacat.debug("Comparing guid|sysmeta_guid: " + guid.getValue() + "|" + sysmeta.getIdentifier().getValue());
 //        if (!guid.getIdentifier().equals(sysmeta.getIdentifier().getIdentifier())) {
 //            throw new InvalidSystemMetadata(1180, 
 //                "GUID in method call does not match GUID in system metadata.");
@@ -194,7 +194,7 @@
         logMetacat.debug("Checking if identifier exists...");
         // Check that the identifier does not already exist
         IdentifierManager im = IdentifierManager.getInstance();
-        if (im.identifierExists(guid.getIdentifier())) {
+        if (im.identifierExists(guid.getValue())) {
             throw new IdentifierNotUnique(1120, 
                 "GUID is already in use by an existing object.");
         }
@@ -201,7 +201,7 @@
 
         // generate guid/localId pair for object
         logMetacat.debug("Generating a guid/localId mapping");
-        String localId = im.generateLocalId(guid.getIdentifier(), 1);
+        String localId = im.generateLocalId(guid.getValue(), 1);
 
         // TODO: generate guid/localId pair for sysmeta
         // TODO: update system metadata fields
@@ -285,19 +285,19 @@
         return guid;
     }
 
-    public IdentifierType delete(AuthToken token, IdentifierType guid)
+    public Identifier delete(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             NotImplemented {
         throw new NotImplemented(1000, "This method not yet implemented.");
     }
 
-    public DescribeResponse describe(AuthToken token, IdentifierType guid)
+    public DescribeResponse describe(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             NotImplemented {
         throw new NotImplemented(1000, "This method not yet implemented.");
     }
     
-    public InputStream get(AuthToken token, IdentifierType guid)
+    public InputStream get(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             NotImplemented {
         
@@ -308,7 +308,7 @@
         // Look up the localId for this global identifier
         IdentifierManager im = IdentifierManager.getInstance();
         try {
-            final String localId = im.getLocalId(guid.getIdentifier());
+            final String localId = im.getLocalId(guid.getValue());
 
             final InputStreamFromOutputStream<String> objectStream = 
                 new InputStreamFromOutputStream<String>() {
@@ -392,13 +392,13 @@
 */
     }
 
-    public Checksum getChecksum(AuthToken token, IdentifierType guid)
+    public Checksum getChecksum(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             InvalidRequest, NotImplemented {
         throw new NotImplemented(1000, "This method not yet implemented.");
     }
 
-    public Checksum getChecksum(AuthToken token, IdentifierType guid, 
+    public Checksum getChecksum(AuthToken token, Identifier guid, 
             String checksumAlgorithm) throws InvalidToken, ServiceFailure, 
             NotAuthorized, NotFound, InvalidRequest, NotImplemented {
         throw new NotImplemented(1000, "This method not yet implemented.");
@@ -410,7 +410,7 @@
         throw new NotImplemented(1000, "This method not yet implemented.");
     }
 
-    public SystemMetadata getSystemMetadata(AuthToken token, IdentifierType guid)
+    public SystemMetadata getSystemMetadata(AuthToken token, Identifier guid)
             throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
             InvalidRequest, NotImplemented {
         
@@ -424,8 +424,8 @@
         throw new NotImplemented(1000, "This method not yet implemented.");
     }
 
-    public IdentifierType update(AuthToken token, IdentifierType guid, 
-            InputStream object, IdentifierType obsoletedGuid, SystemMetadata sysmeta) 
+    public Identifier update(AuthToken token, Identifier guid, 
+            InputStream object, Identifier obsoletedGuid, SystemMetadata sysmeta) 
             throws InvalidToken, ServiceFailure, NotAuthorized, IdentifierNotUnique, 
             UnsupportedType, InsufficientResources, NotFound, InvalidSystemMetadata, 
             NotImplemented {
Index: build.xml
===================================================================
--- build.xml	(revision 5319)
+++ build.xml	(revision 5320)
@@ -1554,7 +1554,7 @@
          sibling of the current build directory. Requires maven2 to
          be installed and on the path. -->
     <target name="dataone-service" if="d1.available">
-        <property name="d1.jar" value="dataone-service-api-0.1.0.jar"/>
+        <property name="d1.jar" value="dataone-service-api-0.3.0.jar"/>
 
         <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
                       mavenHome="${maven.home}">
