在REST服务下的虚拟目录下托管时,Soap Web服务错误

时间:2012-09-24 10:53:58

标签: c# wcf web-services iis

我试图自己找到一些解决方案,但我失败了。我在IIS中的虚拟目录下托管了WCF Web服务

http://host/soap/myservice.svc

Soap服务放在REST服务

http://host - REST services address

当我尝试从WCF服务执行方法时,我收到此错误(在服务器端):

  

无法查找频道以接收传入消息。找不到端点或SOAP操作。

当我在同一个IIS上托管WCF服务时,但作为独立应用程序

http://host:81
一切正常。但我需要他们在这些REST服务之下。

这是由svcutil生成的客户端web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://host/soapservices/MyService.svc"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
          contract="IMyService" name="WSHttpBinding_IMyService">
        <identity>
          <servicePrincipalName value="host/host" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

这是肥皂服务的web.config

  </appSettings>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="MyServiceName">
        <host>
          <baseAddresses>
            <add baseAddress="http://host/SOAPServices/MyService/" />
          </baseAddresses>
        </host>
        <endpoint address="" binding="wsHttpBinding" contract="IMyService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True" />
          <serviceDebug includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
</configuration>

0 个答案:

没有答案
相关问题