相关疑难解决方法(0)

IIS8上的WCF;*.svc处理程序映射不起作用

我试图在2012年版本8400上运行IIS8中运行的wcf服务.

在安装web角色时,没有像2008年那样找到wcf的东西(3.51以下).

安装时svc处理程序映射丢失了,所以我做了一个:

%windir%\Microsoft.NET\Framework\v3.0\WindowsCommunication Foundation\ServiceModelReg.exe –i
Run Code Online (Sandbox Code Playgroud)

现在处理程序映射就在那里,但我仍然得到:

The resource you are looking for does not have a handler associated with it.
Run Code Online (Sandbox Code Playgroud)

(我删除了静态文件处理程序.)

该网站使用经典管道以使用模拟.

asp.net wcf iis-8 iis-8.5

264
推荐指数
6
解决办法
20万
查看次数

如何启用WCF跟踪?

更新:

我一直试图打开WCF跟踪,但仍然没有成功......以下是我最新的更新.

我是否需要获得写入以下位置的许可?

  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "@\\myservername\folder1\traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
Run Code Online (Sandbox Code Playgroud)

我正在使用.NET Framework 3.5.

为调试目的打开WCF跟踪的逐步说明是什么?

wcf

152
推荐指数
3
解决办法
18万
查看次数

从浏览器运行WCF方法

我在Visual Studio 2010中使用C#创建一个非常基本的WCF服务.我想知道是否可以通过键入以下内容直接从浏览器运行我的方法://localhost:49815/Service1.svc/methodName(parameterValue)

这是我的代码的本质.

接口:

using ...
namespace WcfService1{   
    [ServiceContract]
    public interface IService1{
        [OperationContract]
        [WebGet]
        string echoWithGet(string s);
        [OperationContract]
        [WebInvoke]
        string echoWithPost(string s);
    }
}
Run Code Online (Sandbox Code Playgroud)

方法:

 public string echoWithGet(string s ){
            return "Get: "+s;
        }

 public string echoWithPost(string s){
            return "Post: " + s;
        }
Run Code Online (Sandbox Code Playgroud)

c# wcf

30
推荐指数
2
解决办法
8万
查看次数

WCF服务在方法请求上返回404

我有一个WCF服务页面只通过SSL运行WebGets/WebInvokes - 它在我的本地机器上工作正常(自签名证书).但是,在生产时,我可以访问service.svc(并且它向我提供有关如何使用的消息),但service.svc/AnyRequest返回404.两种环境都在IIS 7.5中托管.

我启用了跟踪,服务甚至没有获取任何方法请求(例如service.svc/SomeRequest),但它处理service.svc得很好.它也在听https://computername.domain.net/path/service.svc- 这是正常的吗?它通常应该指向https://publicfacing.com/path/service.svc吗?

另请注意,生产服务器在IIS中托管多个站点.

下面是我的web.config的system.serviceModel部分.从这里建议SSLBehave .

  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="TransportSecurity">
          <security mode="Transport">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SSLBehave">
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="https" port="443"/>
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="UserManagement.ajaxAspNetAjaxBehavior">
          <webHttp defaultOutgoingResponseFormat="Json" defaultBodyStyle="Wrapped" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true" />
    <services>
      <service name="UserManagement.ajax" behaviorConfiguration="SSLBehave">
        <endpoint address="" behaviorConfiguration="UserManagement.ajaxAspNetAjaxBehavior"
          binding="webHttpBinding" bindingConfiguration="TransportSecurity" contract="UserManagement.ajax" />
      </service>
    </services>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

c# ssl wcf iis-7.5

21
推荐指数
5
解决办法
4万
查看次数

通过HTTPS和HTTP访问时,WCF服务无法正常工作

我在IIS中安装了SSL证书.

现在,当我导航到我的域https://www.example.com/时,页面加载了更正.但是,当我尝试通过https:https://www.example.com/service.svc/newprofile/? id = 8 & ipaddress = 124.162.13.109接近一个Web服务(通常在http上工作正常)时,我得到:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /service.svc/newprofile/
Run Code Online (Sandbox Code Playgroud)

我也在这里查了一下

但是重命名webHttpBindingbasicHttpBinding与jsonp组合引发不支持的错误.此外,web.config中的服务元素名称与实现我的合同的类的完全限定名称相匹配.

这是我的web.config

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
  <webHttpBinding> …
Run Code Online (Sandbox Code Playgroud)

vb.net asp.net ssl wcf web-services

11
推荐指数
2
解决办法
3万
查看次数

标签 统计

wcf ×5

asp.net ×2

c# ×2

ssl ×2

iis-7.5 ×1

iis-8 ×1

iis-8.5 ×1

vb.net ×1

web-services ×1