Table of Contents

Hi Everyone,

Please excuse me if this is not the correct place to post this question, It seemed like the most appropriate place.  I am trying to develop a .net/c# web application to allow users to search and update fedora records and I was wondering if anyone had or knew of any sample code out there that shows to utilize the APIs in c#.  I have found a few older references to this page http://www.fedora.info/resources/faq_old.shtml#csharpclient, unfortunately it is no longer available.  At this point I am adding the wsdls for api-a, api-m, and gsearch as web references however I am having trouble implementing them.  Any help is greatly appreciated.

Thanks

Joe

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels

1 Comment

  1. Hi Joe,

    This should get you started.

    1. Grab the WSDLs for access/management (http(s)://<yourfedorahost>/fedora/wsdl?api=API-A / http(s)://<yourfedorahost>/fedora/wsdl?api=API-M) and save them locally
    2. Use the wsdl.exe application to generate the FedoraAPIAMService and FedoraAPIAService class files.  (C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin*[\x64]*\wsdl.exe)
    3. Add the autogenerated files into your project.
    4. Open up the files and add the following constructors:      
    public FedoraAPIAService(string userName, string password){
                this.Url = "http://localhost:8080/fedora/services/access";
                this.Credentials = new System.Net.NetworkCredential(userName, password);
            }
    
    public FedoraAPIAService(string userName, string password, string Url){
                this.Url = Url;
                this.Credentials = new System.Net.NetworkCredential(userName, password);
            }
    
    public FedoraAPIMService(string userName, string password)
            {
                this.Url = "http://localhost:8080/fedora/services/management";
                this.Credentials = new System.Net.NetworkCredential(userName, password);
            }
    
    public FedoraAPIMService(string userName, string password, string Url)
            {
                this.Url = Url;
                this.Credentials = new System.Net.NetworkCredential(userName, password);
            }

    I've attached a simple console project with a few wrapper methods as an example. You'll need to update the following fields in FedoraAPIA.cs to reflect the values in your configuration.

    private static string _UserName = "fedoraAdmin";
    private static string _Password = "fedoraPass";
    private static string _ManagementUrl = "http://localhost:8080/fedora/services/management";

    Thanks
    AJ

    Fedora.NET.zip