calling webservice from access

  • Thread starter Thread starter Keith G Hicks
  • Start date Start date
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
 
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
 
Back
Top