Hi all,
going back to the root... I am trying to connect my favorite C++ tools to BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It seems that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX API connector.
Writing a API connector is quite difficult for me, since I don't have the required networks knowledge.
Has somebody already some code to that purposes ?
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the basex-api repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++ tools to BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It seems that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX API connector.
Writing a API connector is quite difficult for me, since I don't have the required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Dirk,
Thanx for your answer. Indeed, I tried to install the existing C API. For windows user :
Some *.h, *.c files of the BaseX C API seems to work only with a gcc compiler. Some others one don't even exists under windows, at least I did not found them : 1) the BaseX C API seems to use the open SSL framework. I did download and install it, but have some problem to compile it with Visual C++ Express. 2) Some needed c/h files (see for instance "#include <unistd.h>) are located in the MinGW distribution for windows. However, these files are bound to GCC compiler, and can not be compiled with Microsoft compiler.
Indeed, I am trying to mimic in C++ the C# API, that works on my configuration. But it is not easy for me, since I never manipulated sockets and TCP connectors, and will take me a lot of time. Thus, if anyone already did the work, that would be so nice to share :)
Cheers,
Jean-Marc
2014/1/3 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the basex-api repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++ tools to BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It seems that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX API connector.
Writing a API connector is quite difficult for me, since I don't have the required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hello Jean-Marc,
I see your point. Unfortunately, I don't have any experience doing Windows socket programming (nor do I run any Windows OS), so I am of not much help here. But I would guess the C code can be quite easily replaced (e.g. OpenSSL is most likely just used for the md5 computation) and based on some articles like http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in... I would guess windows socket programming can be done quite similar to Unix sockets.
Cheers, Dirk
On 03/01/14 11:33, jean-marc Mercier wrote:
Hi Dirk,
Thanx for your answer. Indeed, I tried to install the existing C API. For windows user :
Some *.h, *.c files of the BaseX C API seems to work only with a gcc compiler. Some others one don't even exists under windows, at least I did not found them :
- the BaseX C API seems to use the open SSL framework. I did download and
install it, but have some problem to compile it with Visual C++ Express. 2) Some needed c/h files (see for instance "#include <unistd.h>) are located in the MinGW distribution for windows. However, these files are bound to GCC compiler, and can not be compiled with Microsoft compiler.
Indeed, I am trying to mimic in C++ the C# API, that works on my configuration. But it is not easy for me, since I never manipulated sockets and TCP connectors, and will take me a lot of time. Thus, if anyone already did the work, that would be so nice to share :)
Cheers,
Jean-Marc
2014/1/3 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the basex-api repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++ tools to BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It seems that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX API connector.
Writing a API connector is quite difficult for me, since I don't have the required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Dirk,
Thx. Well, I am suffering a lot to develop this C++ BaseX API. I did not succeed in installing the openssl MD5 algorithm, but I finally found a MD5 algorithm that seems to work (at least, it seems to compute the MD5 hash for "admin" correctly). However, after two days, I still can't connect to the BaseX server, and can't figure out why...
Concerning TCP connectors, I think that it is wiser to use boost::asio library : it is not MS, and seems to becoming the C++ network standard library.
Since this C++ BaseX API'fate is to be published (provided we can make it work!), maybe somebody in BaseX team, that have some experience with C++, could have a look to it ? I put the current code at https://github.com/JohnLeM/BaseXCPPAPI, as a bottle in the sea :(
2014/1/5 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
I see your point. Unfortunately, I don't have any experience doing Windows socket programming (nor do I run any Windows OS), so I am of not much help here. But I would guess the C code can be quite easily replaced (e.g. OpenSSL is most likely just used for the md5 computation) and based on some articles like
http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in... I would guess windows socket programming can be done quite similar to Unix sockets.
Cheers, Dirk
On 03/01/14 11:33, jean-marc Mercier wrote:
Hi Dirk,
Thanx for your answer. Indeed, I tried to install the existing C API. For windows user :
Some *.h, *.c files of the BaseX C API seems to work only with a gcc compiler. Some others one don't even exists under windows, at least I did not found them :
- the BaseX C API seems to use the open SSL framework. I did download
and
install it, but have some problem to compile it with Visual C++ Express. 2) Some needed c/h files (see for instance "#include <unistd.h>) are located in the MinGW distribution for windows. However, these files are bound to GCC compiler, and can not be compiled with Microsoft compiler.
Indeed, I am trying to mimic in C++ the C# API, that works on my configuration. But it is not easy for me, since I never manipulated
sockets
and TCP connectors, and will take me a lot of time. Thus, if anyone
already
did the work, that would be so nice to share :)
Cheers,
Jean-Marc
2014/1/3 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the basex-api repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++ tools
to
BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It
seems
that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX API connector.
Writing a API connector is quite difficult for me, since I don't have
the
required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
Hello,
I still can't connect to BaseX. I checked that I sent to the server exactly the same bytes than the C# connector that worked on my configuration.
Is there any way to make the BaseX server echoing any input request on a particular socket to check exactly what my TCP connector is sending ?
2014/1/5 jean-marc Mercier jeanmarc.mercier@gmail.com
Dirk,
Thx. Well, I am suffering a lot to develop this C++ BaseX API. I did not succeed in installing the openssl MD5 algorithm, but I finally found a MD5 algorithm that seems to work (at least, it seems to compute the MD5 hash for "admin" correctly). However, after two days, I still can't connect to the BaseX server, and can't figure out why...
Concerning TCP connectors, I think that it is wiser to use boost::asio library : it is not MS, and seems to becoming the C++ network standard library.
Since this C++ BaseX API'fate is to be published (provided we can make it work!), maybe somebody in BaseX team, that have some experience with C++, could have a look to it ? I put the current code at https://github.com/JohnLeM/BaseXCPPAPI, as a bottle in the sea :(
2014/1/5 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
I see your point. Unfortunately, I don't have any experience doing Windows socket programming (nor do I run any Windows OS), so I am of not much help here. But I would guess the C code can be quite easily replaced (e.g. OpenSSL is most likely just used for the md5 computation) and based on some articles like
http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in... I would guess windows socket programming can be done quite similar to Unix sockets.
Cheers, Dirk
On 03/01/14 11:33, jean-marc Mercier wrote:
Hi Dirk,
Thanx for your answer. Indeed, I tried to install the existing C API.
For
windows user :
Some *.h, *.c files of the BaseX C API seems to work only with a gcc compiler. Some others one don't even exists under windows, at least I
did
not found them :
- the BaseX C API seems to use the open SSL framework. I did download
and
install it, but have some problem to compile it with Visual C++ Express. 2) Some needed c/h files (see for instance "#include <unistd.h>) are located in the MinGW distribution for windows. However, these files are bound to GCC compiler, and can not be compiled with Microsoft compiler.
Indeed, I am trying to mimic in C++ the C# API, that works on my configuration. But it is not easy for me, since I never manipulated
sockets
and TCP connectors, and will take me a lot of time. Thus, if anyone
already
did the work, that would be so nice to share :)
Cheers,
Jean-Marc
2014/1/3 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the
basex-api
repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++
tools to
BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It
seems
that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX
API
connector.
Writing a API connector is quite difficult for me, since I don't have
the
required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
On Mon, 2014-01-06 at 21:15 +0100, jean-marc Mercier wrote:
Hello,
I still can't connect to BaseX. I checked that I sent to the server exactly the same bytes than the C# connector that worked on my configuration.
Is there any way to make the BaseX server echoing any input request on a particular socket to check exactly what my TCP connector is sending ?
I do have an old C program I wrote years ago that saves a copy of data sent on a socket into a file; I wrote it for Unix but maybe it'd work for you. There are some packages for Linux that do soemthing similar too.
Make sure that you check the return value of every system call you use - writing to a socket does not necessarily succeed. Make sure also that your code connects to the right IP address and port - e.g. try connecting to something like a Web server where you can see the logs, and sending "GET / HTTP/1.0\r\nAccept: */*\r\n\r\n" at it. Forgetting to convert addresses and port numbers to network order is sometimes an issue.
Liam
Liam,
Thx for your proposal. Unix C++ user can use the already existing BaseX API, that unfortunately don't work for poor Windows users. My program do send information to BaseX server, since the server replies through its log "admin (the user account I am using to log in) -- acces denied". There is probably something in the MD5 algorithm that I am using. However, I checked that the MD5 algorithm computes correctly the hash for 'admin'.
If BaseX server could echo the incoming request, that would be of great help, but I don't know how to do this. If nobody knows, I will have to fork the BAseX code and to try compile a server to see what is happening on the server side...that is probably some days of hard works :(
2014/1/6 Liam R E Quin liam@w3.org
On Mon, 2014-01-06 at 21:15 +0100, jean-marc Mercier wrote:
Hello,
I still can't connect to BaseX. I checked that I sent to the server
exactly
the same bytes than the C# connector that worked on my configuration.
Is there any way to make the BaseX server echoing any input request on a particular socket to check exactly what my TCP connector is sending ?
I do have an old C program I wrote years ago that saves a copy of data sent on a socket into a file; I wrote it for Unix but maybe it'd work for you. There are some packages for Linux that do soemthing similar too.
Make sure that you check the return value of every system call you use - writing to a socket does not necessarily succeed. Make sure also that your code connects to the right IP address and port - e.g. try connecting to something like a Web server where you can see the logs, and sending "GET / HTTP/1.0\r\nAccept: */*\r\n\r\n" at it. Forgetting to convert addresses and port numbers to network order is sometimes an issue.
Liam
-- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Hello Jean-Marc,
No, there is no such echoing service. Especially, because you sait that you can't connect, so the authentification does not seem to have taken place. So doing anything before authentification would be rather weird.
Also, you did not mention _what_ excactly does not work. However, you can use tools like Wireshark (which should also be available on Windows, I guess) to analyze all your traffic (you can also filter for traffic to specific ports, so just relevant stuff is shown to you).
Cheers, Dirk
On 06/01/14 21:15, jean-marc Mercier wrote:
Hello,
I still can't connect to BaseX. I checked that I sent to the server exactly the same bytes than the C# connector that worked on my configuration.
Is there any way to make the BaseX server echoing any input request on a particular socket to check exactly what my TCP connector is sending ?
2014/1/5 jean-marc Mercier jeanmarc.mercier@gmail.com
Dirk,
Thx. Well, I am suffering a lot to develop this C++ BaseX API. I did not succeed in installing the openssl MD5 algorithm, but I finally found a MD5 algorithm that seems to work (at least, it seems to compute the MD5 hash for "admin" correctly). However, after two days, I still can't connect to the BaseX server, and can't figure out why...
Concerning TCP connectors, I think that it is wiser to use boost::asio library : it is not MS, and seems to becoming the C++ network standard library.
Since this C++ BaseX API'fate is to be published (provided we can make it work!), maybe somebody in BaseX team, that have some experience with C++, could have a look to it ? I put the current code at https://github.com/JohnLeM/BaseXCPPAPI, as a bottle in the sea :(
2014/1/5 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
I see your point. Unfortunately, I don't have any experience doing Windows socket programming (nor do I run any Windows OS), so I am of not much help here. But I would guess the C code can be quite easily replaced (e.g. OpenSSL is most likely just used for the md5 computation) and based on some articles like
http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in... I would guess windows socket programming can be done quite similar to Unix sockets.
Cheers, Dirk
On 03/01/14 11:33, jean-marc Mercier wrote:
Hi Dirk,
Thanx for your answer. Indeed, I tried to install the existing C API.
For
windows user :
Some *.h, *.c files of the BaseX C API seems to work only with a gcc compiler. Some others one don't even exists under windows, at least I
did
not found them :
- the BaseX C API seems to use the open SSL framework. I did download
and
install it, but have some problem to compile it with Visual C++ Express. 2) Some needed c/h files (see for instance "#include <unistd.h>) are located in the MinGW distribution for windows. However, these files are bound to GCC compiler, and can not be compiled with Microsoft compiler.
Indeed, I am trying to mimic in C++ the C# API, that works on my configuration. But it is not easy for me, since I never manipulated
sockets
and TCP connectors, and will take me a lot of time. Thus, if anyone
already
did the work, that would be so nice to share :)
Cheers,
Jean-Marc
2014/1/3 Dirk Kirsten dk@basex.org
Hello Jean-Marc,
What problems did you experience when using the provided C API (https://github.com/BaseXdb/basex-api/tree/master/src/main/c) under Windows 7? It should also work under windows. Additionally, you can find the source code of the C API at the
basex-api
repository, so this should give you a starting point if you ant to rewrite anything.
Cheers, Dirk
On 03/01/14 11:12, jean-marc Mercier wrote:
Hi all,
going back to the root... I am trying to connect my favorite C++
tools to
BaseX. Unfortunately, I am using visual C++ 12 Express under windows 7. It
seems
that windows users will not be able to use the existing BaseX API C connector, and need another one. Thus I started to code a C++ BaseX
API
connector.
Writing a API connector is quite difficult for me, since I don't have
the
required networks knowledge.
Has somebody already some code to that purposes ?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
basex-talk@mailman.uni-konstanz.de