首页 新闻 会员 周边

宿主在iis的wcf, 能被控制台应用程序添加引用吗?

0
悬赏园豆:15 [已关闭问题] 关闭于 2013-11-18 21:06

宿主在iis  web.config

<?xml version="1.0"?>
<configuration>
  <appSettings/>
  <connectionStrings/>
  <system.web>
    <compilation debug="true">
    </compilation>
    <authentication mode="Forms"/>
  </system.web>
  <system.serviceModel>
   
    <behaviors>
      <endpointBehaviors>
        <behavior name="AllenBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="mexBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
          <serviceThrottling maxConcurrentCalls="1000"  maxConcurrentSessions="1000" />
        </behavior>
      </serviceBehaviors>

    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service name="jqueryWCF.WCFservice" behaviorConfiguration="mexBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://127.0.0.1:9999/Service"/>
          </baseAddresses>
        </host>
        <endpoint address="" behaviorConfiguration="AllenBehavior" binding="webHttpBinding" contract="jqueryWCF.WCFservice" />
        <endpoint address="mex" binding="mexHttpBinding"
 contract="IMetadataExchange" />
      </service>
      
    </services>
  </system.serviceModel>
 </configuration>
View Code

前台jquery ajax是可以直接访问的测试过了

元数据有也发布出来了 通过url访问有下图:

 

但是为什么通过控制台 添加服务引用会出现下图的情况呢??

wcf
koi的主页 koi | 初学一级 | 园豆:4
提问于:2013-11-03 22:00
< >
分享
所有回答(2)
0

我估计不行

男人要爽 | 园豆:6 (初学一级) | 2013-11-03 23:31
0

应该可以吧,之前学过一段时间的WCF,用的不多就忘了.你可以到博客园大神级人物http://www.cnblogs.com/artech/ 那里找些资料

平常心队长 | 园豆:1113 (小虾三级) | 2013-11-04 09:51

你有试过吗

支持(0) 反对(0) koi | 园豆:4 (初学一级) | 2013-11-04 12:49

@koi: 好像用过.在IIS下和控制台程序下都做过宿主.也用控制台程序做过Client,但是不是通过添加服务引用的方式使用service的,我忘了.

你那样吧,你建立一个控制台程序,找一个公共的服务引用,就是其他公司公开的服务引用,你看下会不会出错,来验证下是不是你代码的问题.

支持(0) 反对(0) 平常心队长 | 园豆:1113 (小虾三级) | 2013-11-05 09:15
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册