从C ++项目添加Web引用到WCF服务时出错

时间:2011-01-24 17:58:10

标签: c++ wcf

我们部署了WCF服务,并尝试从 native C ++项目添加Web引用(在VS2005中编写)导致错误:

  

为NotificationReceiver1创建Web服务代理文件...

     

sproxy:错误SDL1000:未指定的错误

     

sproxy:错误SDL1002:生成输出文件失败:“NotificationReceiver1.h”

这是部署的WCF服务配置文件:

<system.serviceModel>
<services>
  <service behaviorConfiguration="NotificationService.NotificationReceiverBehavior" name="NotificationService.NotificationReceiver">
    <endpoint address="" binding="basicHttpBinding" contract="NotificationService.INotificationReceiver" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="NotificationService.NotificationReceiverBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
</system.serviceModel>

这个服务可以用WebServiceStudio打开并且工作正常(通常我用它来测试web / wcf服务)......但VS无法生成h文件......为什么?

欢迎任何想法。

非常感谢。

1 个答案:

答案 0 :(得分:3)

你可以尝试使用svcutil从命令行创建它,如:

svcutil.exe / language:cpp /out:NotificationReceiver.h /config:app.config http://localhost:8000/NotificationService