0

I am using VS2012. My client configuration not updated when I have added service reference of WCF REST service. It is updating if I change binding to 'basicHttpBinding' in a WCF Service. Following is my WCF Service configuration.

<endpoint address="" binding="webHttpBinding" contract="MyService.IService1" behaviorConfiguration="RestBehavior">

<endpointBehaviors>
    <behavior name="RestBehavior">
      <webHttp helpEnabled="true"/>
    </behavior>
  </endpointBehaviors>

My WCF service is split into following projects.

  1. WCFHost(has only .svc file with web.config mentioned above and uses following two projs)
  2. WCFInterfaces (Class library, has no config file)
  3. WCFImplementaions (Class library, has no config files)

I wonder if I am doing anything wrong with decoupling of WCF layers above and hence my client app unable to get config details when Service reference added.

4

1 回答 1

1

Visual Studio 服务引用具有魔力,因为 SOAP 服务提供 WSDL。如果您创建 REST 服务,则没有 WSDL,它将无法工作。当您切换到基本 HTTP 时,它就可以工作,因为它是 SOAP。您必须使用像 HttpClient 这样的 HTTP 库来与 REST 端点通信。

于 2013-06-28T15:32:19.993 回答