Newbie question - how to use Web Service function in Access

D

Dave

I am a long-time VBA/Access developer but a newcomer to web services.
I have data in an Access table that I need to write to a SQL Server
table via web services. The web services developers have provided me 3
functions to do this - Initialize, which retrieves an instance ID,
Import, which is called for each row of data to be transferred, and
Finalize, which runs after all records have been transferred.

The developers are not VB guys and have not able to tell me how to
invoke these functions in my code, and my examination of the functions
leaves me clueless as to how to use them - obviously they wrap my data
in xml tags and send it to SQL Server, but I have no idea how to pass
the data to them.

I find reams of info online about creating web services, etc., but
have found nothing to help me use a service that already exists.

Any suggestions would be appreciated.

Thanks
Dave
 
S

Scott M.

All you need to do is create a WebService project in VS.NET and create 3
different WebMethods that perform the tasks you've indicated. You don't
need to do anything on the Access side (although I really wouldn't be using
Access for web site storage/web service access).

Then a front-end ASP.NET project can be made that simply adds a Web
Reference to your Web Services assembly. VS.NET takes care of the rest.

-Scott
 
A

Andrew Brook

Hi Dave,

Have the developers given you a WSDL file? This file would contain all the
information you would need to access the webservice. As well as this, do you
intend to use VBA to transfer the data?

I'd just write a VB.NET application to open your access database, and call
the webservice. If you have the location of the WSDL file then you can
simply 'add a web reference' from inside VS and point it at the file. A
class will then be generated for you that will hide some of the complexity.

hope this helps,
Andrew
 
D

Dave

Hi Dave,

Have the developers given you a WSDL file? This file would contain all the
information you would need to access the webservice. As well as this, do you
intend to use VBA to transfer the data?

I'd just write a VB.NET application to open your access database, and call
the webservice. If you have the location of the WSDL file then you can
simply 'add a web reference' from inside VS and point it at the file. A
class will then be generated for you that will hide some of the complexity.

hope this helps,
Andrew

Andrew,

I need to invoke the data transfer from within the Access application.
When the user finishes processing records within the application, he/
she needs to be able to click a button that launches code to transfer
the data from the Access table to SQL Server via the web service
functions that have been provided.

Thanks
Dave
 
S

Scott M.

Your going to have a harder time accessing the service from within access.
You'll have to make the SOAP Requests and process the SOAP Responses
manually. Access is not a .NET application, so none of the .NET Framework
stuff will help you.
 
A

Andrew Brook

I guess it would be much easier if the webservice in question supports HTTP
POST requests rather than using SOAP. I've not looked into it, but i'm sure
VBA must have some functions to help with HTTP requests and responses.

Andrew
 
S

Scott M.

Yes, VBA does have HTTP request and response objects (the XMLHTTP component
will do), but if you are consuming a web service, you'll need more than
that. Web services use SOAP, so you will have to work with SOAP.
 
A

Andrew Brook

They don't have to use SOAP, i've wrriten a couple in .NET that were
accessible using HTTP GET purely because the client using SOAP was out of
the question. The services in question only required simple types as input
and returned a chunk of plain XML as a response, no SOAP in sight :)

Andrew
 
S

Scott M.

If there was no SOAP in sight, then it wasn't a web service you were
calling. Passing XML around is not the same thing as calling a web service.
 
A

Andrew Brook

Well the service was defined and generated from a WSDL file. Is it possible
to define something other than a web service with WSDL? :)

Andrew
 
S

Scott M.

Nothing if you can get your hands on it. My understanding is that it was
discontinued some time ago though.
 
S

Scott M.

Not as far as I know. But again, if you consumed a web service, there was
SOAP somewhere. Perhaps it was automatically generated in a way I'm
unfamiliar with.
 
E

Egghead

I believe if you google it, you can find it. I use it in a VB6.0 app last
year, and it serves the basic ok; just cannot be very q with it.
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top