WebServiceProxy Example
Moderators: gto, cipto_kh, EgonHugeist
WebServiceProxy Example
Hello! Anyone has an example of how to configure WebServiceProxy for mysql connection?
Thanks!!!
Thanks!!!
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: WebServiceProxy Example
Hello fjtrooper,
based on my own configuration a very simple server config could look like this:
In TZConnection you would set UTF8 as the connection character set. Host is the ip address or host name of your server. Maybe you have to specify the port number. The database name would be "ZeosTest". Username and password will be forwarded to MySQL / MariaDB in this configuration.
Please note: I didn't test the webserviceproxy protocol with MariaDB or MySQL. Please let me know of any problems.
Best regards,
Jan
based on my own configuration a very simple server config could look like this:
Code: Select all
[general]
Database Prefix = db.
Security Prefix = sec.
Listening Port = 8000
[db.ZeosTest]
ClientCodepage = UTF8
Database = mydatabase
HostName = somehost
LibraryLocation = C:\Program Files (x86)\MariaDB\MariaDB Connector C\lib\libmariadb.dll
Protocol = mysql
Please note: I didn't test the webserviceproxy protocol with MariaDB or MySQL. Please let me know of any problems.
Best regards,
Jan
Re: WebServiceProxy Example
Ok thanks, I'll try and I'll give you feedback.
THX
THX
Re: WebServiceProxy Example
I did the configuration, but Lazarus hangs when I activate ZConnection until I stop WebServiceProxy, never connect, and I receive an error message like this.
HTTP Request to
https://localhost:8000/serices/IZeosProxy Failed
It tries to find "https" and not "http" by default?
Thanks
HTTP Request to
https://localhost:8000/serices/IZeosProxy Failed
It tries to find "https" and not "http" by default?
Thanks
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: WebServiceProxy Example
Yes - the idea was to make it secure by design. Even though the server doesn't use TLS (a restriction of the Webservice Toolkit) I figured that most users would want to use apache with SSL configured as a reverse proxy for attaching the clients. Otherwise passwords and data will be sent unencrypted over the wire...
You can tell the client to use http by using the following line:
Code: Select all
ZConnection.Properties.Add('ProxyProtocol=http');
Re: WebServiceProxy Example
Perfect! Now it seems to connect.
I have now a new error message
When I acitvate ZConnection the error message is:
Code="Server"
Message= "Requested database driver was not found"
In ZConnection I set Protocol WebServiceProxy, and LibraryLocation is my libzdbcproxy.dll location.
In zeosproxy.ini, LibraryLocation of DB is also set and seems OK.
Thank you very much!!!!
I have now a new error message
When I acitvate ZConnection the error message is:
Code="Server"
Message= "Requested database driver was not found"
In ZConnection I set Protocol WebServiceProxy, and LibraryLocation is my libzdbcproxy.dll location.
In zeosproxy.ini, LibraryLocation of DB is also set and seems OK.
Thank you very much!!!!
Re: WebServiceProxy Example
This error is using MYsql server.fjtrooper wrote: ↑10.02.2022, 10:26 Perfect! Now it seems to connect.
I have now a new error message
When I acitvate ZConnection the error message is:
Code="Server"
Message= "Requested database driver was not found"
In ZConnection I set Protocol WebServiceProxy, and LibraryLocation is my libzdbcproxy.dll location.
In zeosproxy.ini, LibraryLocation of DB is also set and seems OK.
Thank you very much!!!!
When I try with Postgresql , the error is:
Code = "Server"
Message = "System error, (OS Code 126):
Can't find specific module
Re: WebServiceProxy Example
I forgot tell you that I'm using version 8
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: WebServiceProxy Example
I didn't experiment with Lazarus much, I have to say. I assume that the >Code="Server"< part means that the problem happens on the server side. >Message= "Requested database driver was not found"< means that the requested driver was not found by Zeos. What is yor value for "Protocol"? Did you set it to "mysql"? Could you share your zeosproxy.ini? That could make hunting down the problem much more easy
Re: WebServiceProxy Example
[General]
Database Prefix = db.
Security Prefix = sec.
;IP Address = 0.0.0.0
Listening Port = 8000
[db.bdfarmacia]
ClientCodepage = UTF8
Database = bdfarmacia
HostName = 127.0.0.1
LibraryLocation = c:\library\libmysql.dll
Protocol = mysql
[db.test]
ClientCodepage = UTF8
Database = test
HostName = localhost
LibraryLocation = c:\library\libpq.dll
Protocol = postgresql
Database Prefix = db.
Security Prefix = sec.
;IP Address = 0.0.0.0
Listening Port = 8000
[db.bdfarmacia]
ClientCodepage = UTF8
Database = bdfarmacia
HostName = 127.0.0.1
LibraryLocation = c:\library\libmysql.dll
Protocol = mysql
[db.test]
ClientCodepage = UTF8
Database = test
HostName = localhost
LibraryLocation = c:\library\libpq.dll
Protocol = postgresql
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: WebServiceProxy Example
The proxy server doesn't include all protocols by default. My mistake. Please add ZDbcMySql to the uses clause of the zeosproxyunit.pas or to the ZDbcProxyServer.pas - depending on wether you use the server service or the server application. That should add mysql to the list of available protocols. I will add the unit in the source control too.
Re: WebServiceProxy Example
marsupilami wrote: ↑13.02.2022, 09:13 The proxy server doesn't include all protocols by default. My mistake. Please add ZDbcMySql to the uses clause of the zeosproxyunit.pas or to the ZDbcProxyServer.pas - depending on wether you use the server service or the server application. That should add mysql to the list of available protocols. I will add the unit in the source control too.
Oki I'll try it!
Thanks!
Re: WebServiceProxy Example
Hello! I've tested and have theses problems:
When I add ZDbcmysql to Proxyserver Application, doesn't compile, and get this error.
ZDbcMySqlStatement.pas(2143,17) Error: identifier idents no member "AddAscii7Text"
When I add ZDbcpostgresql to Proxyserver Application, it compiles perfect.
As with zdbcmysql compilation fails, I couldn't try with mysql, so I tried to test with Postgresql.
Using Postgresql I always get the error "System Error (OS 193)", also trying the connection with a direct conection in a TEST APP and also fails.
I tried with postgesql 11 and 14, and also with different libpq.dll.
I use version 8 revision 7770
Thanks!!
When I add ZDbcmysql to Proxyserver Application, doesn't compile, and get this error.
ZDbcMySqlStatement.pas(2143,17) Error: identifier idents no member "AddAscii7Text"
When I add ZDbcpostgresql to Proxyserver Application, it compiles perfect.
As with zdbcmysql compilation fails, I couldn't try with mysql, so I tried to test with Postgresql.
Using Postgresql I always get the error "System Error (OS 193)", also trying the connection with a direct conection in a TEST APP and also fails.
I tried with postgesql 11 and 14, and also with different libpq.dll.
I use version 8 revision 7770
Thanks!!
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: WebServiceProxy Example
Hello fjtrooper,
I added all currently supported protocols to the proxy servers. Please update your sources from SVN. The proxy servers compile for me without problems. My configuration:
Lazarus 2.0.12, Windows 32 bits, FPC 3.2.2.
Please let me know, if this fixes your problems.
Best regards,
Jan
I added all currently supported protocols to the proxy servers. Please update your sources from SVN. The proxy servers compile for me without problems. My configuration:
Lazarus 2.0.12, Windows 32 bits, FPC 3.2.2.
Please let me know, if this fixes your problems.
Best regards,
Jan
Re: WebServiceProxy Example
okk I'll try! Thanks!marsupilami wrote: ↑18.02.2022, 09:35 Hello fjtrooper,
I added all currently supported protocols to the proxy servers. Please update your sources from SVN. The proxy servers compile for me without problems. My configuration:
Lazarus 2.0.12, Windows 32 bits, FPC 3.2.2.
Please let me know, if this fixes your problems.
Best regards,
Jan