Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling WCF Service from MS Access

Tags:

wcf

ms-access

I want to create a create a WCF Service which is invoked on the button click of MS Access Form.

like image 581
Shahid Hazoor Avatar asked Oct 15 '10 13:10

Shahid Hazoor


People also ask

How can I access WCF service?

With the service running, right click the project that will contain the WCF client proxy and select Add > Service Reference. In the Add Service Reference Dialog, type in the URL to the service you want to call and click the Go button. The dialog will display a list of services available at the address you specify.

How do I hit a WCF service?

To step into a WCF Service Create a Visual Studio solution that contains both the WCF client and WCF service projects. In Solution Explorer, right-click the WCF Client project and then click Set as Startup Project. Enable debugging in the app. config or web.

Can we call WCF service from Java?

For Java client application, I think you can generate the proxy class from Eclipse and invoke the call to WCF service. The general steps are as follows: Prepare the WCF service and run the service. Create the Java client application in Eclipse IDE, and name the project, like WCFClientApp in this case.


1 Answers

You CAN consume WCF services through MS Access, but not via standard WCF mechanisms. You'll need to consume the service via GET requests, POST requests, or SOAP requests.

  1. One way to accomplish this for SOAP requests on the Access side is using the SOAP toolkit: http://msdn.microsoft.com/en-us/library/aa140260%28office.10%29.aspx

  2. Another way that would work for GET, POST or SOAP requests is using XMLHTTP (if you go the SOAP route, you'll need to make your own SOAP envelope in the XML): http://www.codemaker.co.uk/it/tips/ado_conn.htm (search for XMLHTTP)

On the WCF side you have a couple of choices:

  1. Host a WebHttpBinding service. This gives you options to expose GET and POST endpoints for your services. See http://www.windowsitpro.com/article/net-framework2/exposing-classic-http-endpoints-with-wcf-in-net-3-5.aspx.

  2. Host a BasicHttpBinding service that exposes a SOAP endpoint (this is the default WCF endpoint if you create a new service in Visual Studio). If you go this route, you probably want to set it to use legacy XML serialization and WSDL for compatibility if you go with option 1 on the access end (see http://msdn.microsoft.com/en-us/library/system.servicemodel.xmlserializerformatattribute.aspx).

One other thing to note: If you create a BasicHttpBinding WCF Service with XmlSerializerFormatAttribute, you are basically getting (from a data exchange standpoint) the same thing as if you were to write a legacy asmx service.

like image 76
Jeff Avatar answered Sep 22 '22 12:09

Jeff