|
#21
|
|||
|
|||
|
OK here is another problem with gSOAP for botting purposes. Because it generates a lot of automatically named files which then get compiled along with the main application, I have come up against a serious problem that I do not know how to resolve simply. Because I want to use BOTH global and UK enchange services I have to run the gSOAP parser on 2 separate wsdl files. Now the output is written to the SAME file and so until I work out how to change this I am restricted to using either global OR exchange API calls within one application. There is probably a way of resolving this but I have officially given up now on gSOAP and will start from scratch and try and do it the good old fashioned way using hard coded XML and parsing responses. I hope that this serves as a warning to anyone coming here to use gSOAP as it seems you can get so far then hit a brick wall. Alternatively someone may actually know how to resolve the issue I have mentioned in which case gSOAP would be a very useful tool....
|
|
#22
|
|||
|
|||
|
Quote:
You CAN modify autogenerated files to select one of two addresses. That's easy. The problem is gSoap is really monstrous. It has megabytes of code and code quality is real shit: Code:
Entry **p, *q; if (table == (Table*)0) return (Entry*)0; for (p = &table->list; *p != (Entry*)0 && (*p)->next != (Entry*)0; p = &(*p)->next); q = *p; *p = (Entry*)0; return q; Code:
17.10.2011 23:24 44 BetfairApiStats.cpp 17.10.2011 23:24 1 028 BetfairApiStats.h 17.10.2011 23:24 903 BetfairCallback.cpp 17.10.2011 23:24 616 BetfairCallback.h 17.10.2011 23:24 5 491 BetfairDecoder.cpp 17.10.2011 23:24 596 BetfairDecoder.h 17.10.2011 23:24 12 477 BetfairDecompressor.cpp 17.10.2011 23:24 620 BetfairDecompressor.h 17.10.2011 23:24 4 357 BetfairEncoder.cpp 17.10.2011 23:24 667 BetfairEncoder.h 20.01.2012 15:01 7 085 BetfairExchangeService.cpp 20.01.2012 15:01 2 514 BetfairExchangeService.h 17.10.2011 23:24 2 196 BetfairGlobalService.cpp 17.10.2011 23:24 907 BetfairGlobalService.h 17.10.2011 23:24 357 BetfairHttpTransport.cpp 17.10.2011 23:24 540 BetfairHttpTransport.h 17.10.2011 23:24 6 783 BetfairInvocation.cpp 17.10.2011 23:24 1 506 BetfairInvocation.h 20.01.2012 15:01 23 627 BetfairSession.cpp 20.01.2012 14:59 3 835 BetfairSession.h 17.10.2011 23:24 3 697 BetfairStake.cpp 17.10.2011 23:24 445 BetfairStake.h Last edited by AlgoTrader; 04-19-2012 at 06:25 AM |
|
#23
|
|||
|
|||
|
Yes I am giving up on gSOAP. I am sure it works IF you know exactly how to do it. I did try one more thing - you can run wsdl2h on multiple .wsdl files to get what you want but then you have to build with certain flags set to get it to link properly. In a nutshell it is no longer a C++ issue, it is an issue with wrestling with a 277 user guide to someone elses libraries that just seem too much hassle to use. I am sure that if you could be bothered to spend weeks on forums seeking the answer for the specific approach you want then gSOAP would be a good and reliable solution (it seems that people who get it working are ultimately happy with it). Since I am only wanting this for betfair purposes I will try and code it from the system socket level and hard code the API request xml messages by hand.
|
|
#24
|
|||
|
|||
|
Quote:
I maximally use third-party code and I use JavaScript. I use exellent HTTP libs instead of sockets, I use third-party XML parsers/generators, I use libs to do most of routine work. It took me two weeks to make a complete BF API solution. |
|
#25
|
|||
|
|||
|
But what else can I do?? wsdl2h acts on .wsdl files. Betfair has 3 wsdl files of which I am wanting to use just 2 (global and UKExchange) ?? Running this generates soapGlobalProxy and soapExchangeProxy classes of which I need to create instances of both if I want to get all the API functionality I need. I am getting to the point where I am tempted to stick with perl .My reasons for wanting to use c++ is that i know how to create multithreaded apps, but perl I dont know how to do threading. Also I am stubbourn and want to crack gSOAP as it has started to annoy me immensely.
|
|
#26
|
|||
|
|||
|
Perl threading is pain. Perl asynchronous programming even bigger pain. It is easy for simple apps but no way to do complex parallel apps.
|
|
#27
|
|||
|
|||
|
OK for anyone using gSOAP, I finally managed to build a simple app to access the API. The problem is that it doesnt work - I have 2 proxy classes (one for the BFGlobal wsdl and one for the UKExchange wsdl) but my program crashes if I create them both in the same scope!!! I can have one but as soon as I create the other - BANG. I am wondering if this is a OpenSSL issue. Has anyone experienced a similar issue at any stage?? In the meantime I am going to try and get something working using libcurl as I see that people have had success with that approach on Linux. It should not be this hard surely!!!!!!
|
|
#28
|
|||
|
|||
|
When I moved from Windows to Linux full time, I spent several months trying out new programming languages because I only knew VB6. I was keen to learn a "real" language and opted for C. As a learning project, I decided to re-write my betfair bots using gSoap. Several annoying weeks later, I decided to try C++ instead. About a month after that, I decided to go back to the "old" method of sending xml strings over http. I used gSoap (and still do) to generate the XML request files but delete all the other crap it generates. Even the http stuff seemed more difficult than it should be in C/C++, so I soon gave up on it.
I now program everything in Python and find it about 100 times more productive. If I were you (or anyone else just starting out), I'd look hard at Node.js. It's a simple interface on top of a turbocharged C/C++ engine. And from what I can see, it allows for event-driven, non-blocking, async requests, so there is no need to use threading.
__________________
http://www.bespokebots.com Last edited by wotsisname; 04-23-2012 at 11:59 PM |
|
#29
|
|||
|
|||
|
Quote:
Quote:
PS I would strongly suggest not to use gSoap, it is just a trouble maker |
|
#30
|
|||
|
|||
|
Yes I have given up on gSOAP. I was looking at the boost asio library today and that looks like it could be a way forward. Unfortunately I have to use C++ as all of my analysis and mathematical routines are written in C++ otherwise I would completely transer to another setup. Nevertheless, I will take a look at Node.js
|
| Post Reply |
| Tags |
| betfari api c++ |
| Thread Tools | |
| Display Modes | |
|
|