WCF托管问题 [英] WCF hosting issues

查看:237
本文介绍了WCF托管问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我不知道是否有人能帮助我,我一直在敲打我的头撞墙试图解决这个问题,但没有运气尚未:(我有IIS6托管我们的内部网络上的远程服务器上的WCF,<一个HREF =HTTP://systemservices/ServiceManagerServices.svc相对=nofollow> HTTP://systemservices/ServiceManagerServices.svc 我可以在我的浏览器访问该服务,尝试使用发送请求然而,当。 WcfTestClient,我得到以下错误:

 >错误:无法从
&获得元数据GT; HTTP:// systemservices / ServiceManagerServices.svc如果这是一个Windows
>(R)通信基础服务,您可以访问,请
>检查已启用元数据发布在指定
> ;地址如需帮助实现元数据发布,请参考
> MSDN文档在
> http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata交易所
>错误网址:HTTP://systemservices/ServiceManagerServices.svc
>元数据包含无法解析的引用:
>的http://systemservices/ServiceManagerServices.svc。没有
个端点听在http://systemservices/ServiceManagerServices.svc
>这可以接受的消息。这通常是由一个不正确的
个引起的;地址或SOAP行动。见的InnerException,如果存在的话,为更
个细节。无法连接到远程服务器没有连接
>可以作出,因为目标机器积极拒绝,
> 172.16.25.221:80HTTP得到错误网址:HTTP://systemservices/ServiceManagerServices.svc有一个错误
>下载的http://systemservices/ServiceManagerServices.svc。
>无法连接到远程服务器无连接可以作出
>因为目标机器积极地拒绝它172.16.25.221:80



我试图改变我的web.config这么多不同的值,这是不真实的,但什么!任何想法将是非常欢迎!



这是我的web.config

 <?XML版本=1.0>?; 
<结构>
< configSections>
< sectionGroup名=的applicationSettingsTYPE =System.Configuration.ApplicationSettingsGroup,系统,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089>
<节名称=ServiceManager.Services.Properties.SettingsTYPE =System.Configuration.ClientSettingsSection,系统,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089requirePermission =FALSE/> ;
< / sectionGroup>
< / configSections>
<&的System.Web GT;
<的customErrors模式=关/>
<编译调试=真targetFramework =4.0/>
< /system.web>
< system.serviceModel>
<服务和GT;
<服务名称=ServiceManager.Services.ServiceManagerServicesbehaviorConfiguration =WCFServiceBehavior>
<端点地址=绑定=的wsHttpBinding合同=ServiceManager.Services.IServiceManagerServices/>
<端点地址=MEX绑定=mexHttpBinding合同=IMetadataExchange接口/>
< /服务>
< /服务>
<&行为GT;
< serviceBehaviors>
<行为NAME =WCFServiceBehavior>
< serviceMetadata httpGetEnabled =真/>
< serviceDebug includeExceptionDetailInFaults =真/>
< /行为>
< / serviceBehaviors>
< /行为>
< /system.serviceModel>
< system.webServer>
<模块runAllManagedModulesForAllRequests =真/>
< /system.webServer>
< /结构>


解决方案

既然您无法连接,它可能是一个访问限制,但此消息可以显示当你被人踢回等问题,所以这可能是一个缺少引用的二进制文件,或无效 DataContract 或类似的东西的使用



首先,打开一些诊断:

 <系统.diagnostics> 
<来源和GT;
<信源名称=System.ServiceModelswitchValue =警告,ActivityTracingpropagateActivity =真>
<&听众GT;
<加上TYPE =System.Diagnostics.DefaultTraceListenerNAME =默认>
<滤波器类型=/>
< /添加>
<添加名称=ServiceModelTraceListener>
<滤波器类型=/>
< /添加>
< /听众>
< /源>
< /来源>
< sharedListeners>
<添加initializeData =path\to\trace.svclog
型=System.Diagnostics.XmlWriterTraceListener,系统,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089
产品名称=ServiceModelTraceListenertraceOutputOptions =时间戳>
<滤波器类型=/>
< /添加>
< / sharedListeners>





现在运行的服务,得到错误和使用 SvcTraceTool (只要到计划Files\Microsoft的SDK 并做 SVC )打开输出日志搜索。这会给你更多的过程的概述,此时它出错并指向异常的详细信息 - 有时只是告诉你在事件日志中查找特定异常


Hi I wonder if someone can help me, I've been banging my head against the wall trying to solve this but no luck yet :( I have a WCF hosted on IIS6 on a remote server on our internal network, http://systemservices/ServiceManagerServices.svc. I can access the service in my browser, however when trying to send a request using WcfTestClient, i get the following error:

> Error: Cannot obtain Metadata from
> http://systemservices/ServiceManagerServices.svc If this is a Windows
> (R) Communication Foundation service to which you have access, please
> check that you have enabled metadata publishing at the specified
> address.  For help enabling metadata publishing, please refer to the
> MSDN documentation at
> http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
> Error    URI: http://systemservices/ServiceManagerServices.svc   
> Metadata contains a reference that cannot be resolved:
> 'http://systemservices/ServiceManagerServices.svc'.    There was no
> endpoint listening at http://systemservices/ServiceManagerServices.svc
> that could accept the message. This is often caused by an incorrect
> address or SOAP action. See InnerException, if present, for more
> details.    Unable to connect to the remote server    No connection
> could be made because the target machine actively refused it
> 172.16.25.221:80HTTP GET Error    URI: http://systemservices/ServiceManagerServices.svc    There was an error
> downloading 'http://systemservices/ServiceManagerServices.svc'.   
> Unable to connect to the remote server    No connection could be made
> because the target machine actively refused it 172.16.25.221:80

I have tried changing my web.config to so many different values it is untrue, however nothing! Any ideas would be really welcome!!!

This is my web.config

<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="ServiceManager.Services.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.serviceModel>
        <services>
            <service name="ServiceManager.Services.ServiceManagerServices" behaviorConfiguration="WCFServiceBehavior">
                <endpoint address="" binding="wsHttpBinding" contract="ServiceManager.Services.IServiceManagerServices" />
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="WCFServiceBehavior">
                    <serviceMetadata httpGetEnabled="True"/>
                    <serviceDebug includeExceptionDetailInFaults="True" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>

解决方案

Since you can't connect, it could be an access restriction, but this message can show when you've been kicked back for other issues, so this could be a missing referenced binary, or use of an invalid DataContract or something similar.

Firstly, turn on some diagnostics:

<system.diagnostics>
  <sources>
    <source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true">
      <listeners>
        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
          <filter type="" />
        </add>
        <add name="ServiceModelTraceListener">
          <filter type="" />
        </add>
      </listeners>
    </source>
  </sources>
  <sharedListeners>
    <add initializeData="path\to\trace.svclog"
      type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
    <filter type="" />
  </add>
</sharedListeners>

Now run the service, get the error and using SvcTraceTool (just go to Program Files\Microsoft SDKs and do a search for svc) open up the output log. This will give you more of an overview of the process, at which point it goes wrong and point to more details of the exception - sometimes just telling you to look in the Event Log for the specific exception.

这篇关于WCF托管问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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