// 基本型別對應
typedef char* xsd__string;
typedef int xsd__int;
typedef bool xsd__boolean;
typedef double xsd__double;
// 搜尋結果項目
struct typens__ResultElement {
xsd__string summary;
xsd__string URL;
xsd__string snippet;
xsd__string title;
xsd__string cachedSize;
xsd__boolean relatedInformationPresent;
xsd__string hostName;
struct typens__DirectoryCategory* directoryCategory;
xsd__string directoryTitle;
};
// 完整尋回應
struct typens__GoogleSearchResult {
xsd__boolean documentFiltering;
xsd__string searchComments;
xsd__int estimatedTotalResultsCount;
xsd__boolean estimateIsExact;
struct ResultElementArray* resultElements;
xsd__string searchQuery;
xsd__int startIndex;
xsd__int endIndex;
xsd__string searchTips;
struct DirectoryCategoryArray* directoryCategories;
xsd__double searchTime;
};
| 函式 | 用途 |
|---|---|
CreateSoapSession | 建立 SOAP 連線,傳入伺服器位址與 API Key |
SetSoapProxy | 設定 HTTP Proxy (主機、埠) |
doGoogleSearch | 執行搜尋,參數對應 Google 官方文件 |
doGetCachedPage | 取得 Google 快取頁面 (Base64 編碼) |
doSpellingSuggestion | 拼字建議 |
GetSoapErrorMessage | 取得最後錯誤訊息 |
FreeSoapCache / FreeSoapSession | 釋放資源 |
WSDL 定義服務端點 https://api.google.com/search/beta2,採 RPC 風格 SOAP over HTTP,包含 doGoogleSearch、doGetCachedPage、doSpellingSuggestion 三個操作,訊息格式使用 urn:GoogleSearch 命名空間。