我们目前有一个工作在https上的WCF服务。但我们希望将其更改为仅在http上工作。
谁能告诉我,我需要做哪些更改才能使wcf服务在http上工作。下面是我的配置文件值。除了web.config,我还需要处理其他什么吗??
非常感谢ANy的帮助
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="myservername" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_Windows"
maxReceivedMessageSize="500000000" maxBufferPoolSize="500000000"
messageEncoding="Mtom">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Windows" />
</security>
<readerQuotas maxDepth="500000000"
maxArrayLength="500000000" maxBytesPerRead="500000000"
maxNameTableCharCount="500000000" maxStringContentLength="500000000"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="myproject_Behavior">
<dataContractSerializer />
<synchronousReceive />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WebService.WSBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="WebService.Forms_WSBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WebService.WSBehavior"
name="IMMSWebService.mywebservice_WS">
<endpoint
address="myproject_WS"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_Windows"
bindingName="basicHttpBinding"
contract="WebService.ICommand">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
<host>
<timeouts closeTimeout="00:10:00" openTimeout="00:10:00" />
</host>
</service>
<service behaviorConfiguration="WebService.Forms_WSBehavior"
name="WebService.Forms_WS">
<endpoint
address=""
binding="wsHttpBinding"
contract="WebService.IForms_WS">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>发布于 2010-04-05 00:18:12
变化
<security mode="TransportWithMessageCredential">至
<security mode="None">也会改变
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />至
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />最后,任何
httpsGetEnabled到httpGetEnabled
发布于 2010-04-05 03:20:35
我将我的配置文件更改为NOne,当我尝试从IE访问服务时,收到此错误消息:找不到与绑定了basicHttpBinding的端点的方案http匹配的基地址。注册的基址方案是https。关于下一步该怎么做,有什么帮助吗?
发布于 2010-04-05 04:10:49
对于基地址的第二个问题:在服务标签中创建一个<baseAddresses>元素:
<services>
<service behaviorConfiguration="WebService.WSBehavior"
name="IMMSWebService.mywebservice_WS">
<endpoint
address="myproject_WS"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_Windows"
bindingName="basicHttpBinding"
contract="WebService.ICommand">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://yourserver:8181/YourServiceBase" />
</baseAddresses>
<timeouts closeTimeout="00:10:00" openTimeout="00:10:00" />
</host>
</service>或者在端点上使用完全限定的地址。
<services>
<service behaviorConfiguration="WebService.WSBehavior"
name="IMMSWebService.mywebservice_WS">
<endpoint
address="http://yourserver:8181/YourServiceBase/myproject_WS"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_Windows"
bindingName="basicHttpBinding"
contract="WebService.ICommand">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<timeouts closeTimeout="00:10:00" openTimeout="00:10:00" />
</host>
</service>https://stackoverflow.com/questions/2575019
复制相似问题