我试图在 MSDN上跟随初学者的演示视频到WCF页面.

第一个视频或多或少都很好.我现在正走向第二个视频的结尾.我正在使用VS2010 / .NET 4.0,而视频似乎使用的是VS2008(我假设是.NET 3.5,但我不记得).

I’m using the following demo

我们刚刚添加了3个端点:一个普通的http,net.tcp和net.pipe.当我现在尝试运行项目时,Web服务无法启动.

system.invalidOperationException: Cannot load the X.509 certificate identity specified in the configuration.
   at System.ServiceModel.Description.ConfigLoader.LoadIdentity(IdentityElement element)
   at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host,ServiceDescription description,ServiceElement serviceElement,Action`1 addBaseAddress)
   at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader,ServiceElement serviceSection)
   at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader,String configurationName)
   at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
   at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
   at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType,UriSchemeKeyedCollection baseAddresses)
   at System.ServiceModel.ServiceHost..ctor(Type serviceType,Uri[] baseAddresses)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type,ServiceKind kind)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)

基于我的Google fu,我遇到了这个帖子:“Cannot load the X.509 certificate identity specified in the configuration”

我真的不想参与证书,因为我还在尝试基础知识,所以我按照该帖子中的建议添加了< dns value =“localhost”/>标签.异常更改:

Please try changing the HTTP port to 8732 or running as Administrator.
System.ServiceModel.AddressAccessDeniedException: HTTP Could not register URL http://+:8080/EvalService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at System.ServiceModel.Channels.SharedHttpTransportManager.Onopen()
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.SharedHttpTransportManager.Onopen()
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.TransportChannelListener.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.HttpChannelListener.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnOuterListenerOpen(ChannelDemuxerFilter filter,IChannelListener listener,TimeSpan timeout)
   at System.ServiceModel.Channels.SingletonChannelListener`3.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.dispatcher.Channeldispatcher.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostBase.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.NegotiationTokenAuthenticator`1.Onopen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj,TimeSpan timeout)
   at System.ServiceModel.Security.SecurityUtils.OpenTokenAuthenticatorIfrequired(SecurityTokenAuthenticator tokenAuthenticator,TimeSpan timeout)
   at System.ServiceModel.Security.SecurityProtocolFactory.Open(String propertyName,Boolean requiredForForwardDirection,SecurityTokenAuthenticator authenticator,TimeSpan timeout)
   at System.ServiceModel.Security.SymmetricSecurityProtocolFactory.Onopen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecurityProtocolFactory.Open(Boolean actAsInitiator,TimeSpan timeout)
   at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelListener`1.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.dispatcher.Channeldispatcher.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostBase.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenAuthenticator.Onopen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj,TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionServerSettings.Onopen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionServerSettings.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelListener`1.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.dispatcher.Channeldispatcher.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostBase.Onopen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.open()
   at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
System.Net.HttpListenerException (0x80004005): Access is denied
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at System.ServiceModel.Channels.SharedHttpTransportManager.Onopen()

所以,我试着说它说:将端口更改为8732,但仍然抛出异常,这次说请尝试将HTTP端口更改为8732 … HTTP无法注册URL http://:8732 / EvalService / ….:P

我试过评论新的终点无济于事.即使是原始的也会因此错误而失败.如果我把它们放回原来的端口[不是那么] 1337也没关系.

这是App.config,并没有什么突出的问题:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="EvalServiceLibrary.EvalService">
        <clear />
        <endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService"
          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectdistinguishedname" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
          listenUriMode="Explicit">
          <identity>
              <dns value="localhost" />
              <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectdistinguishedname" />
          </identity>
        </endpoint>
        <endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService"
          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectdistinguishedname" />
          </identity>
        </endpoint>
        <endpoint address="net.tcp://localhost:8888/EvalService" binding="netTcpBinding"
          contract="EvalServiceLibrary.IEvalService" listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectdistinguishedname" />
          </identity>
        </endpoint>
        <endpoint address="net.pipe://localhost/EvalService" binding="netNamedPipeBinding"
          bindingConfiguration="" contract="EvalServiceLibrary.IEvalService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/EvalService" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

有什么问题/我该如何解决?

我也遵循相同的 webcast并遇到了同样的问题.我根据其他人的建议评论了这些条目,从而解决了证书问题.

我更正了“请尝试将HTTP端口更改为8732或以管理员身份运行”,方法是将“Design_Time_Addresses”添加回我的网址

不起作用

<add baseAddress="http://localhost:8732/AMessageService" />

作品!

<add baseAddress="http://localhost:8732/Design_Time_Addresses/AMessageService" />

wcf – 为我配置“使用端点配置服务”演示失败(Microsoft / endpoint.tv / Pluralsight)的更多相关文章

  1. ios – 尝试向我们分配IP而不是localhost或home时,NSURLSession失败

    我有一台本地运行的服务器(我的IP是192.168.0.98),并且已经尝试使用一些网络代码来访问它.最初这是通过AFNetworking完成的,但我现在用这样的NSURLSession完成了它:然后我用这3个URL运行它:>http://localhost:8080/api–>作品.>http://127.0.0.1:8080/api–>作品.>http://192.168.0.98:8080/

  2. iOS 10.3:模拟器HTTPS localhost:SSL错误

    这适用于iOS10.2及更低版本,但升级到10.3后,当模拟器尝试通过HTTPS连接到运行在localhost上的开发服务器时,Xcode控制台会输出以下错误:打印出URLSessionDataTask返回的错误显示:参考:Apple:Developer:GuidesandSampleCode:TechnicalNoteTN2232:HTTPSServerTrustEvaluation要创建自签名

  3. KeyStone安装部署笔记

    KeyStone客户端:OpenStack身份服务API的命令行接口。OpenStack出于扩展性的考虑也支持多个region。下面的命令在regionOne创建了keystone的三种端点:为admin租户和用户申请令牌:最后验证admin租户和用户:输出结果验证了身份服务工作正常,Keystone安装部署成功。

  4. 从Android应用程序中消耗WCF Web服务?

    我想从Android应用程序中使用WCFWeb服务.我曾经使用过.asmxweb服务,但我不知道如何在Android应用程序中使用SCFWeb服务.我用谷歌搜索它但没有找到任何东西.如果有人做过,请帮助我.提前致谢.解决方法Hereisanarticleexplaininghowtoconsumewebservicewithandroidingeneral当涉及到WCF并且可以与您想要小心的jav

  5. 如何将android客户端连接到我的笔记本电脑内的Apache服务器(php)的localhost?

    我的笔记本电脑中的localhost-127.0.0.1或android10.0.0.1中的localhost?>那么,如果我想从android访问localhost来调用PHP来运行?哪个ip地址/url我需要放在Android应用程序?我需要在httpconfig中为XAMPP修改任何内容吗?解决方法使用ipconfig在笔记本电脑中找到您的IP地址.在手机中使用该地址而不是127.0.0.1.

  6. 尝试从Android模拟器连接到我的REST服务器时连接被拒绝

    考虑以下android代码,请解决我的问题:在我的笔记本电脑上运行REST服务器..我可以从我的浏览器访问该服务器并获得正确的结果…在模拟器中,当我将URL传递为http://www.google.com时,我得到了正确的结果,但是当我使用我的localhosturl时,我得到连接拒绝…

  7. android – 为什么我的StringRequest永远在onErrorResponse方法?

    我正在尝试从Android中执行POST请求,以在PHPmyadmin中插入一些信息.我在用什么>Slim使连接和查询与数据库存储在PHPmyadmin.>XAMPP来模拟本地服务器.>Volley来消费Android的请求.Slimpost功能对我来说没有任何问题,因为如果我在Postman应用程序上使用POST模式,数据正被插入到数据库中.该URL可以接受两个由斜杠/分隔的参数.这里有一个例子

  8. vue项目如何实现ip和localhost同时访问

    这篇文章主要介绍了vue项目如何实现ip和localhost同时访问,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

  9. vue项目实现通过ip地址访问和localhost访问方式

    这篇文章主要介绍了vue项目实现通过ip地址访问和localhost访问方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

  10. html5 postMessage前端跨域并前端监听的方法示例

    这篇文章主要介绍了html5 postMessage前端跨域并前端监听的方法示例的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

随机推荐

  1. static – 在页面之间共享数据的最佳实践

    我想知道在UWP的页面之间发送像’selectedItem’等变量的最佳做法是什么?创建一个每个页面都知道的静态全局变量类是一个好主意吗?

  2. .net – 为Windows窗体控件提供百分比宽度/高度

    WindowsForm开发的新手,但在Web开发方面经验丰富.有没有办法为Windows窗体控件指定百分比宽度/高度,以便在用户调整窗口大小时扩展/缩小?当窗口调整大小时,可以编写代码来改变控件的宽度/高度,但我希望有更好的方法,比如在HTML/CSS中.在那儿?

  3. 使用Windows Azure查询表存储数据

    我需要使用特定帐户吗?>将应用程序部署到Azure服务后,如何查询数据?GoogleAppEngine有一个数据查看器/查询工具,Azure有类似的东西吗?>您可以看到的sqlExpressintance仅在开发结构中,并且一旦您表示没有等效,所以请小心使用它.>您可以尝试使用Linqpad查询表格.看看JamieThomson的thispost.

  4. windows – SetupDiGetClassDevs是否与文档中的设备实例ID一起使用?

    有没有更好的方法可以使用DBT_DEVICEARRIVAL事件中的数据获取设备的更多信息?您似乎必须指定DIGCF_ALLCLASSES标志以查找与给定设备实例ID匹配的所有类,或者指定ClassGuid并使用DIGCF_DEFAULT标志.这对我有用:带输出:

  5. Windows Live ID是OpenID提供商吗?

    不,WindowsLiveID不是OpenID提供商.他们使用专有协议.自从他们的“测试版”期结束以来,他们从未宣布计划继续它.

  6. 如果我在代码中进行了更改,是否需要重新安装Windows服务?

    我写了一个Windows服务并安装它.现在我对代码进行了一些更改并重新构建了解决方案.我还应该重新安装服务吗?不,只需停止它,替换文件,然后重新启动它.

  7. 带有双引号的字符串回显使用Windows批处理输出文件

    我正在尝试使用Windows批处理文件重写配置文件.我循环遍历文件的行并查找我想要用指定的新行替换的行.我有一个’函数’将行写入文件问题是%Text%是一个嵌入双引号的字符串.然后失败了.可能还有其他角色也会导致失败.如何才能使用配置文件中的所有文本?尝试将所有“在文本中替换为^”.^是转义字符,因此“将被视为常规字符你可以尝试以下方法:其他可能导致错误的字符是:

  8. .net – 将控制台应用程序转换为服务?

    我正在寻找不同的优势/劣势,将我们长期使用的控制台应用程序转换为Windows服务.我们为ActiveMQ使用了一个叫做java服务包装器的东西,我相信人们告诉我你可以用它包装任何东西.这并不是说你应该用它包装任何东西;我们遇到了这个问题.控制台应用程序是一个.NET控制台应用程序,默认情况下会将大量信息记录到控制台,尽管这是可配置的.任何推荐?我们应该在VisualStudio中将其重建为服务吗?我使用“-install”/“-uninstall”开关执行此操作.例如,seehere.

  9. windows – 捕获外部程序的STDOUT和STDERR *同时*它正在执行(Ruby)

    哦,我在Windows上:-(实际上,它比我想象的要简单,这看起来很完美:…是的,它适用于Windows!

  10. windows – 当我试图批量打印变量时,为什么我得到“Echo is on”

    我想要执行一个简单的批处理文件脚本:当我在XP中运行时,它给了我预期的输出,但是当我在Vista或Windows7中运行它时,我在尝试打印值时得到“EchoisOn”.以下是程序的输出:摆脱集合表达式中的空格.等号(=)的两侧可以并且应该没有空格BTW:我通常在@echo关闭的情况下启动所有批处理文件,并以@echo结束它们,所以我可以避免将代码与批处理文件的输出混合.它只是使您的批处理文件输出更好,更清洁.

返回
顶部