WCF Restful服务中的端点未找到错误 [英] Endpoint not found error in WCF Restful service

查看:103
本文介绍了WCF Restful服务中的端点未找到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在WCF中收到端点未找到错误。




以下是我的WCF web.config





< configuration>



< system.web>

< compilation debug =truetargetframework =4.0>



< system.diagnostics>

< sources>

< source name =System.ServiceModelswitchvalue =Information,ActivityTracing/>

propagateActivity =true>

< listeners> < add name =xml>



< source name =System.ServiceModel.MessageLogging/>

< ;听众> < add name =xml>





< sharedlisteners>

< add initializedata =C:\ logs \TracingAndLogging-service.svclogtype =System.Diagnostics.XmlWriterTraceListener>

name =xml/>



< trace autoflush =true>



< system.webserver>

< modules runallmanagedmodulesforallrequests =true>

< httpprotocol>

< customheaders>

< add name =Access-Control-Allow-Originvalue =*>

< add name =Access-Control-Allow-Headersvalue =Content-Type>









< system.servicemodel>



< diagnostics>

< ! - 在此处启用消息记录。 - >

<! - 记录在运输或服务模式级别收到或发送的所有邮件 - >

< messagelogging logentiremessage =true >

maxMessagesToLog =300

logMessagesAtServiceLevel =true

logMalformedMessages =true

logMessagesAtTransportLevel =true/>





< behavior>

< endpointbehaviors>

< behavior name =PushDataService.EndPtBehav>

< enablewebscript>





< servicebehaviors>

< behavior name =PushDataBehav>

< servicemetadata httpgetenabled =true>

< servicedebug includeexceptiondetailinfaults =false>









< servicehostingen environment aspnetcompatibilityenabled =true>

< standardendpoints>

< webscriptendpoint>

< standardendpoint name =crossdomainscriptaccessenabled =true>







< ;服务>

< service behaviorconfiguration =PushDataBehavname =PushDataService.PushData>

< endpoint address =behaviorconfiguration =PushDataService.EndPtBehav binding =webHttpBinding>

name =PushDataEndPtcontract =PushDataService.IPushData/>

<! - < endpoint address =mex binding =mexHttpBindingcontract =IMetadataExchange> - >





<! - < client>

< endpoint behaviorconfiguration =EndPtBehavbinding =webHttpBinding>

bindingConfiguration =contract =PushDataServic e.IPushData

name =ClientEndPt/>

- >





<! - < system.webserver>

< modules runallmanagedmodulesforallrequests =true>

< directorybrowse enabled =false >

- >









请告诉我

Hi Friends,

I am getting endpoint not found error in WCF.


Below is my WCF web.config


<configuration>

<system.web>
<compilation debug="true" targetframework="4.0">

<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchvalue="Information,ActivityTracing" />
propagateActivity="true">
<listeners> <add name="xml">

<source name="System.ServiceModel.MessageLogging" />
<listeners> <add name="xml">


<sharedlisteners>
<add initializedata="C:\logs\TracingAndLogging-service.svclog" type="System.Diagnostics.XmlWriterTraceListener">
name="xml" />

<trace autoflush="true">

<system.webserver>
<modules runallmanagedmodulesforallrequests="true">
<httpprotocol>
<customheaders>
<add name="Access-Control-Allow-Origin" value="*">
<add name="Access-Control-Allow-Headers" value="Content-Type">




<system.servicemodel>

<diagnostics>
<!-- Enable Message Logging here. -->
<!-- log all messages received or sent at the transport or service model levels -->
<messagelogging logentiremessage="true">
maxMessagesToLog="300"
logMessagesAtServiceLevel="true"
logMalformedMessages="true"
logMessagesAtTransportLevel="true" />


<behaviors>
<endpointbehaviors>
<behavior name="PushDataService.EndPtBehav">
<enablewebscript>


<servicebehaviors>
<behavior name="PushDataBehav">
<servicemetadata httpgetenabled="true">
<servicedebug includeexceptiondetailinfaults="false">




<servicehostingenvironment aspnetcompatibilityenabled="true">
<standardendpoints>
<webscriptendpoint>
<standardendpoint name="" crossdomainscriptaccessenabled="true">



<services>
<service behaviorconfiguration="PushDataBehav" name="PushDataService.PushData">
<endpoint address="" behaviorconfiguration="PushDataService.EndPtBehav" binding="webHttpBinding">
name="PushDataEndPt" contract="PushDataService.IPushData" />
<!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">-->


<!--<client>
<endpoint behaviorconfiguration="EndPtBehav" binding="webHttpBinding">
bindingConfiguration="" contract="PushDataService.IPushData"
name="ClientEndPt" />
-->


<!--<system.webserver>
<modules runallmanagedmodulesforallrequests="true">
<directorybrowse enabled="false">
-->




Please let me know

推荐答案

这篇关于WCF Restful服务中的端点未找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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