Windows Communication Foundation服务中的IIS托管 [英] IIS Hosting in windows communication foundation service

查看:88
本文介绍了Windows Communication Foundation服务中的IIS托管的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人都好,


我正在为IIS Hosting开发示例wcf服务.在端点的Web配置文件中,是否必须使用地址``http://localhost//IISService/Myservice.svc''或我的文件夹(如c) :/documentsettings/visualstudio2008/IISService/Myservice.svc.请清除我的疑问.

解决方案

您应该在客户端配置中将URL用于端点.

配置可以读取如下内容.如d @ nish所述,您使用URL而不是文件系统路径来解析服务端点.


 <   system.serviceModel  > 
    <  绑定 > 
      <   basicHttpBinding  > 
        <  绑定    ="   BasicHttpBinding_MyApplication"  closeTimeout    00:01 :00" 
                     span>          ="   00:01:00"  receiveTimeout   ="     sendTimeout   ="  
 
                     span>          ="   false"  bypassProxyOnLocal   ="     ="   StrongWildcard" 
 
                        ="   1000000"  maxBufferPoolSize   ="     ="   1000000" 
 
                        ="  文本"  textEncoding   ="     transferMode   ="  
                     span>          ="   true" <   readerQuotas     ="   32"  maxStringContentLength   > 8192"     maxArrayLength   ="  16384" 
                          maxBytesPerRead   ="     maxNameTableCharCount   ="    / >> 
          <  安全性    ="   None" <  运输    ="   Windows"  proxyCredentialType   没有"   领域  =" " / <  消息    ="   UserName"  algorithmSuite   默认"   / > 
          <  /security  > 
        <  /binding  > 
      <  /basicHttpBinding  > 
    <  /bindings  > 
    <  客户端 > 
      <  端点   地址   http://localhost/YourVirtualDirectory/SomeService.svc" span> 
 
                     span>        ="   basicHttpBinding"    bindingConfiguration   ="  
 
                     span>        ="   ISomeInterface"   名称  ="    / > 
    <  /client  > 
<  /system.serviceModel  >  




如果您右键单击Visual Studio&中的服务,选择在浏览器中查看",它将打开服务并显示一些用于创建客户端代理的语法.

svcutil.exe http://localhost/YourVirtualDirectory/SomeService.svc?wsdl 




如果您打开Visual Studio命令提示符,运行该命令,它将为您的服务创建代理类& 它还将为您创建一个服务配置文件.


Hai to all,


I am developing the sample wcf service for IIS Hosting.In the web config file in the endpoint whether i have to use the address ''http://localhost//IISService/Myservice.svc'' or my file folder like''c:/documentsettings/visualstudio2008/IISService/Myservice.svc.Please clear my doubt

解决方案

You should be using the URL in the client configuration for the endpoint.


A config could read something like this. As d@nish mentions, you use the URL rather than the file system path to resolve the service endpoint.


<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_MyApplication" closeTimeout="00:01:00"

            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

            maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"

            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

            useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost/YourVirtualDirectory/SomeService.svc"

          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ MyApplication "

          contract="ISomeInterface" name="BasicHttpBinding_ISomeInterface " />
    </client>
</system.serviceModel>




If you right click on your service in Visual Studio & choose ''View In Browser'', it''ll open the service and show you some syntax for creating a client side proxy.

svcutil.exe http://localhost/YourVirtualDirectory/SomeService.svc?wsdl 




If you open your visual studio command prompt & run that command, it''ll create a proxy class for your service & it will also create a service config file for you.


这篇关于Windows Communication Foundation服务中的IIS托管的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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