MarcEdit "rosettastone"

I’ll likely change the name, but I’ve been creating a simple SOAP service that will be able to migrate metadata directly between 7 known metadata formats — or user defined formats, in addition to the ability to harvest OAI to MARC, MARCXML or user defined.  I’m note sure how useful something like this could be for folks since this is really being designed as a tool for interactive metadata translation, but we’ll see soon.  At this point, I don’t have the service on a public server, but I’ve posted a sample of the development WSDL file HERE (btw, don’t use it — it doesn’t link to anything) for those that are interested. 

Calling the service from within C# is pretty easy.  I’m thinking that it will be easy within Java or languages that allow binary data types via a soap response.  For languages like Ruby, which doesn’t if you utilize the actionwebservice gem, I’ll likely create an XML only translation api.  The binary data type gets utilized when passing MARC data to and from the webservices.  Anyway, here’s an example of how it will be called using C#:

 


private void button1_Click(object sender, System.EventArgs e)
{
	localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
	string xmlData = "";
	byte[] marcData;

	System.IO.FileStream objStream = new System.IO.FileStream(@"c:\documents and settings\reeset\My Documents\book\record.mrc", System.IO.FileMode.Open, System.IO.FileAccess.Read);
	marcData = new byte[objStream.Length];
	objStream.Read(marcData, 0, System.Convert.ToInt32(objStream.Length));
	objStream.Close();
	
	
	xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);
	this.richTextBox1.Text = xmlData;

}

private void button2_Click(object sender, System.EventArgs e)
{
localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
byte[] marcData = null;
//string marcData = "";
marcData = objMarc.OAI2MARC("http://digitalcollections.library.oregonstate.edu/cgi-bin/oai.exe", "bracero", "", "", localhost.XML_TYPES.oaidc, localhost.CHAR_SET.MARC8);
//xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);

this.richTextBox1.Text = System.Text.Encoding.UTF8.GetString(marcData, 0, marcData.Length);
}

private void button3_Click(object sender, System.EventArgs e)
{
localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
//byte[] marcData = null;
string marcData = "";
marcData = objMarc.OAI2MARCXML("http://digitalcollections.library.oregonstate.edu/cgi-bin/oai.exe", "bracero", "", "", localhost.XML_TYPES.oaidc);
//xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);

this.richTextBox1.Text = marcData;
}
}

–TR


Posted

in

by

Tags: