从MS Access调用WCF服务 [英] Calling WCF Service from MS Access

查看:111
本文介绍了从MS Access调用WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个创建WCF服务,该服务将在MS Access Form的按钮单击上被调用.

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

推荐答案

您可以通过MS Access使用WCF服务,但不能通过标准WCF机制使用.您需要通过GET请求,POST请求或SOAP请求来使用该服务.

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. 在Access端针对SOAP请求完成此操作的一种方法是使用SOAP工具箱: http://msdn.microsoft.com/en-us /library/aa140260%28office.10%29.aspx

  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

适用于GET,POST或SOAP请求的另一种方法是使用XMLHTTP(如果走SOAP路由,则需要在XML中创建自己的SOAP信封): http://www.codemaker.co.uk/it/tips/ado_conn.htm (搜索XMLHTTP)

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)

在WCF方面,您有两种选择:

On the WCF side you have a couple of choices:

  1. 承载WebHttpBinding服务.这使您可以选择公开服务的GET和POST端点.参见 http://www.windowsitpro.com/article/net-framework2/exposed-classic-http-endpoints-with-wcf-in-net-3-5.aspx .

承载一个暴露SOAP端点的BasicHttpBinding服务(如果在Visual Studio中创建新服务,则这是默认的WCF端点).如果您采用这种方式,那么如果在访问端使用选项1,则可能希望将其设置为使用旧版XML序列化和WSDL来实现兼容性(请参见

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).

需要注意的另一件事:如果使用XmlSerializerFormatAttribute创建BasicHttpBinding WCF服务,则从数据交换的角度来看,您基本上会获得与编写旧版asmx服务相同的东西.

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.

这篇关于从MS Access调用WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆