简体   繁体   English

C#,eXist和Saxon(xml)

[英]C#, eXist and Saxon (xml)

Im in the making of a little project at school: 我正在学校做一个小项目:

A client where you enter calendar events A webpage that presents those events in some nice way. 在其中输入日历事件的客户端以某种不错的方式显示这些事件的网页。

The thing is that we MUST use some database that handles xml-files (free project of choice, mine doesnt really need a database). 问题是我们必须使用一些处理xml文件的数据库(可以选择免费的项目,我的确不需要数据库)。 I googled and found out about eXist (not google-friendly name :-( ). I´ve set up a server and uploaded the xml-file. 我在Google上搜索并找到了关于eXist(不是Google友好的名称:-()。我已经安装了服务器并上传了xml文件。

Questions: 问题:

  1. How to connect? 如何连接?

  2. Im trying to figure out how to send/edit the xml-file from C# (I've installed and added Saxon to Visual Studio) to eXist. 我试图弄清楚如何从C#(我已经安装了Saxon并将其添加到Visual Studio)中向eXist发送/编辑xml文件。 (if connected) (如果已连接)

Im new to the C# language and new to the concept of xml-files. 我是C#语言的新手,也是xml文件概念的新手。

My program can edit local xml-files and add events, now I need to figure out how to write to the database. 我的程序可以编辑本地xml文件并添加事件,现在我需要弄清楚如何写入数据库。

Or is there some other database that handles xml-files and xquerys thats more well documented using C# to connect? 还是有一些其他数据库可以处理使用C#进行连接的xml文件和xquery,它们的文档更加详尽?

Using SOAP: 使用SOAP:

Create .cs files for SOAP connection: 创建用于SOAP连接的.cs文件:

Using the command promt and wsdl.exe found in "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\" 使用在“ C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v7.0A \\ Bin \\”中找到的命令promt和wsdl.exe

"wsdl.exe http://localhost:8080/exist/services/Query?wsdl " “ wsdl.exe http:// localhost:8080 / exist / services / Query?wsdl

"wsdl.exe http://localhost:8080/exist/services/Admin?wsdl " “ wsdl.exe http:// localhost:8080 / exist / services / Admin?wsdl

Gives you the .cs files needed in the project (copy them to project and include). 为您提供项目中所需的.cs文件(将它们复制到project并包含)。

QueryService qs = new QueryService();

private void dbConnection() 
        {            
            try
            {
                currentSession = qs.connect("user", "password");
            }
            catch (Exception catcherror)
            {
                MessageBox.Show(catcherror.ToString(), "Error connecting to the database");
            }

        }

When this is done you find everything you need here: 完成此操作后,您将在这里找到所需的一切:

http://exist-db.org/exist/api/org/exist/soap/Admin.html http://exist-db.org/exist/api/org/exist/soap/Admin.html

http://exist-db.org/exist/api/org/exist/soap/Query.html http://exist-db.org/exist/api/org/exist/soap/Query.html

For eXist-db related questions (note that eXist-db is the better term to google), I'd suggest joining the exist-open mailing list, where most users of eXist-db live and breathe. 对于与eXist-db相关的问题(请注意,eXist-db是Google更好的术语),我建议加入存在开放邮件列表,其中大多数eXist-db用户都可以呼吸和呼吸。 You're likely to get a quick reply there. 您很可能会在那里迅速得到答复。 Subscribe at https://lists.sourceforge.net/lists/listinfo/exist-open . 订阅https://lists.sourceforge.net/lists/listinfo/exist-open Cheers. 干杯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM