Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Google search api webservice
Message
General information
Forum:
Visual FoxPro
Category:
Web Services
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01042495
Message ID:
01042583
Views:
37
This message has been marked as the solution to the initial question of the thread.
The Google web service expects parameter types included but MSSOAP doesn't provide them. You can use Rick's free wwSOAP class from http://west-wind.com/wwsoap.asp. Here's a sample code
SET CLASSLIB TO wwXML Additive
SET PROCEDURE TO wwUtils additive
SET PROCEDURE TO wwHTTP Additive

lcGoogleKey = [...]
lcQuery	= "FoxPro"

lnStart= "0"
lnEnd= 10
llFilter= 0
lcRestrict= ""
llAdultfilter = 0
lcLanguage= ""
lcInputChar= ""
lcOutputChar= ""

lcWsdl = "http://api.google.com/GoogleSearch.wsdl"

loSOAP = NEWOBJECT("wwSOAP", "wwsoap.fxp")

loSDL = loSOAP.ParseServiceWSDL(lcWsdl)
IF ISNULL(loSDL)
   MESSAGEBOX(loSOAP.cErrorMsg)
   RETURN .F.
ENDIF

loGS = loSDL.getmethod("doGoogleSearch")

loSoap.cServerUrl = TRIM(loSDL.cServerUrl)
loSoap.lIncludeDataTypes = .T.

loSOAP.cSoapAction = loGS.cSoapAction
loSOAP.cMethodNameSpaceUri = TRIM(loGS.cMethodNameSpaceUri)
IF NOT EMPTY(loSOAP.cMethodNamespaceuri)
   loSOAP.cMethodNameSpace = "m"
ENDIF

loSoap.AddParameter("k", lcGoogleKey, "string")
loSoap.AddParameter("q", lcQuery, "string")
loSoap.AddParameter("start", lnStart, "int")
loSoap.AddParameter("maxResults", lnEnd, "int")
loSoap.AddParameter("filter", llFilter, "boolean")
loSoap.AddParameter("restrict", lcRestrict, "string")
loSoap.AddParameter("safeSearch", llAdultfilter, "boolean")
loSoap.AddParameter("lr", lcLanguage, "string")
loSoap.AddParameter("ie", lcInputChar, "string")
loSoap.AddParameter("oe", lcOutputChar, "string")

loSoap.lParseReturnedObjects = .F.

lvResult = loSoap.CallMethod(loGS.cName)

IF loSoap.lError
   MESSAGEBOX("Error occurred: " + CHR(10) + loSOAP.cErrorMsg)
   RETURN .F.
ENDIF   

? lvResult.text

RETURN 
>
>I'm experimenting with the google search api webservice using foxpro. I get the following error :
>
>**error :OLE IDispatch exception code 0 from SOAP-ENV:Client: No Deserializer found to deserialize a ':key' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'...
>
>Does someone knows what this error means and can help me resolve it.
>
>This is my code:
<snip>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform