SOAP in Access

K

Kerry

Hi all,

I am very new to SOAP, so hope someone can help me. I am trying to do
an internet search in Access.

Here is what I have been trying for code:
Dim objSoapClient As SoapClient30
Dim strSearch As String
Const YahooAPI As String = "http://api.search.yahoo.com/
WebSearchService/V1/webSearch?query="
Const YahooKey As String = "&appid=MyID"

If IsNull(txtSearch.Value) Then
MsgBox "Nothing to search for.", vbInformation, "Nothing
entered"
Exit Sub
End If
Let strSearch = YahooAPI & Replace(txtSearch.Value, " ", "+") &
"&results=2" & YahooKey
Debug.Print strSearch
Set objSoapClient = New SoapClient30
objSoapClient.MSSoapInit (strSearch)
Let lblResults.Caption = client.result.summary

I get an error message on the line: objSoapClient.MSSoapInit
(strSearch)

Run Time Error '-2147024809 (80070057)':+
WSDLReader:Could not find '/definitions' inside the default WSDL
namespace HRESULT=0x80004005: Unspecified error
- WSDLReader:Loading of the WSDL file failed HRESULT=0x80004005:
Unspecified error
- Client:One of the parameters supplied is invalid.
HRESULT=0x80070057: The parameter is incorrect.
 
A

Arvin Meyer [MVP]

In Access, and generally all of VBA, you must set a reference to the type
library before using any methods or properties in that library. If you
haven't done that, you'd get the error that you see.
 
K

Kerry

In Access, and generally all of VBA, you must set a reference to the type
library before using any methods or properties in that library. If you
haven't done that, you'd get the error that you see.

I have a reference set to Microsoft Soap Type Library v3.0 &
Microsoft XML, v4.0

I get the error message even with the references set. By the way, if
I paste strSearch into the address bar of an internet browser, I do
get SML for the results I am looking for.
 
A

AnandaSim

Hunt up a SOAP or .NET newsgroup. Your issue does not seem to be
Access dominant but something with SOAP, the SOAP object.

HTH
Ananda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top