{
WASP_Runtime::clientInitialize();
WASP_Runtime::clientStart("d:/WASP/conf/client.xml", EXCENV);
GoogleSearchPort gsp;
GoogleSearchResult *ret = gsp.doGoogleSearch("(GoogleKey)", "Cybro", 0, 1000, false, "", true, "", "", "");
ResultElementArray *results = ret->resultElements;
ResultElement **i_results = results->array;
int num_results = results->length;
WASP_DeleteContext dc;
ret->remove(dc);
return num_results;
}
I don't see any problems with that code, and it's almost identical to the FEW examples I've seen. I get an exception call on the call to doGoogleSearch. Anyone have any clue? Thanks.
edit: formatting code
========================================
Cybro :: The Ultimate Online Game Show. Ever.
[edited by - Coaster Kev on May 9, 2004 3:11:38 AM]
🔒 Locked
Google API C++
Advertisement
Original Post
I was wondering if anyone here has experimented with Google API. I'm writing a feature into a game, and it involves interacting with Google. I found a article about using WASP to convert a WSDL file into CPP/H files. I keep running into problems when running the code for doing a search:
quote:
Original post by Anonymous Poster
I''ve got no idea what a "Google API" is but you need to call the constructor to GoogleSearchPort, possibly as
GoogleSearchPort gsp();
or make gsp a pointer and use -> instead of .
GoogleSearchPort gsp = new GoogleSearchPort;
Why on Earth would he need to do that?
Anon: The constructor is *always* called. Also, in this case your code is broken, because
GoogleSearchPort gsp();
is interpreted as the declaration of a local function gsp which returns a GoogleSearchPort instance. The default constructor doesn''t need brackets to be called.
GoogleSearchPort gsp();
is interpreted as the declaration of a local function gsp which returns a GoogleSearchPort instance. The default constructor doesn''t need brackets to be called.
quote:
Original post by Polymorphic OOP
It does not get interpretted as a local function declaration.
If it doesn''t, then your compiler is broken...
[How To Ask Questions|C++ library of container classes, algorithms and iterators. It provides many of the basic algorithms and data structures of computer science." target="_blank">STL Programmer''s Guide|C++ nostyle and Technique FAQ - Designer and implementor the C++ programming language." target="_blank">Bjarne FAQ|C++ FAQ Lite - Frequently Asked Questions about the C++ language." target="_blank">C++ FAQ Lite|C++ Reference - The standard C++ library is a collection of functions, constants, classes and objects that extends the C++ language providing basic functionality to interact with the operating system and some standard classes, objects and algorithms that may be commonly needed." target="_blank">C++ Reference|MSDN]
Google API
Just to clarify, I''m using VC++.NET but the WASP server I''m using to convert the WSDL file to C++ is compliant with VC++.NET.
I''m just wondering if I''m not calling some function that I should be. I''m hoping someone here has had experience with Google API before.
========================================
Cybro :: The Ultimate Online Game Show. Ever.
Just to clarify, I''m using VC++.NET but the WASP server I''m using to convert the WSDL file to C++ is compliant with VC++.NET.
I''m just wondering if I''m not calling some function that I should be. I''m hoping someone here has had experience with Google API before.
========================================
Cybro :: The Ultimate Online Game Show. Ever.
The Google API is really powerful, and really cool IMHO. If i remember right, you can search queries, get spelling suggestions, and something else that I just can't remember at the moment. It's free too. It comes with JAVA, VB, and C# examples... but sadly no c++. It's ok though, I'll figure it out sooner or later.
EDIT: BTW, if you wanna learn how to do this in C++, here is a link: Web Services In C++. Have fun.
[edited by - Coaster Kev on May 9, 2004 9:28:46 PM]
EDIT: BTW, if you wanna learn how to do this in C++, here is a link: Web Services In C++. Have fun.
[edited by - Coaster Kev on May 9, 2004 9:28:46 PM]
I got it working. This is so cool, everyone should try it. I was making it harder than it should''ve been. Since VC++.NET has built in support for web services, I figured out how to let VC do all the work.
========================================
Cybro :: The Ultimate Online Game Show. Ever.
========================================
Cybro :: The Ultimate Online Game Show. Ever.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement