calling webservice from access

K

Keith G Hicks

I used the wizard in VS 2008 to create a webservice containing an simple
function. I know it works because I ran it in my browser and it returned
what I expected.. However, this is very very new to me. I need to call this
function from an Access app. The page http://www.webcontinuum.net/ws_4.aspx
helped but is incomplete from what I can see.

Public Function HelloWorld as String

Dim objSClient As MSSOAPLib.SoapClient
Dim fResult As String

' Point the SOAP API to the web service that we want to call...
Set objSClient = New SoapClient
Call
objSClient.mssoapinit(par_WSDLFile:="http://localhost/HelloWorld/Service.asm
x")

' Call the web service
fResult = objSClient.HelloWorld()
Set objSClient = Nothing

HelloWorld = fResult

End Function

However, the above does not work. It doesn't like the par_WSDLFile. I get
"named argument not found."

Can anyone see what I'm doing wrong?

Thanks,

Keith
 
B

Brendan Reynolds

Keith G Hicks said:
I used the wizard in VS 2008 to create a webservice containing an simple
function. I know it works because I ran it in my browser and it returned
what I expected.. However, this is very very new to me. I need to call
this
function from an Access app. The page
http://www.webcontinuum.net/ws_4.aspx
helped but is incomplete from what I can see.

Public Function HelloWorld as String

Dim objSClient As MSSOAPLib.SoapClient
Dim fResult As String

' Point the SOAP API to the web service that we want to call...
Set objSClient = New SoapClient
Call
objSClient.mssoapinit(par_WSDLFile:="http://localhost/HelloWorld/Service.asm
x")

' Call the web service
fResult = objSClient.HelloWorld()
Set objSClient = Nothing

HelloWorld = fResult

End Function

However, the above does not work. It doesn't like the par_WSDLFile. I get
"named argument not found."

Can anyone see what I'm doing wrong?

Thanks,

Keith


I'm not entirely sure about this, but it looks to me as though you might
have referenced an older version of the Office Soap Type Library. Your code
compiles for me using MSOSOAPLib30 (Microsoft Office Soap Type Library v3.0)
with the following changes (old code commented out for reference) ...

'Dim objSClient As MSSOAPLib.SoapClient
Dim objsclient As MSOSOAPLib30.SoapClient30
 

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