2

リモート サーバーで WCF サービスを利用しようとしています。サービス (場所は の形式http://IntranetServerName:40000/VirtualDirectoryName/ServiceName.svc) を参照できるので、リモートの場所を参照できます。

http://IntranetServerName:40000/VirtualDirectoryName/ServiceName.svc?wsdl次に、(ページの指示に従って)コマンド ラインでsvcutil.exe を実行します。

クライアントが生成されますが、構成ファイルはエンドポイントをリモートの場所から localhost に変換したようで、それが名前付きパイプであると想定しています (そうではありません)。

ネットワーク (ファイアウォールなど) のどこかに問題があると思いますが、私が話したネットワーク担当者は、トラフィックを見ることができ、それはアプリケーションの問題であると言っています。

まず最初に、リモート サーバーをプロキシするときに svcutil が netNamedPipeBinding を提案する原因を理解したいと思います。それが私が抱えているその後の問題についての手がかりを与えるかもしれないことを理解すれば。

リモート サーバーのファイル システムにアクセスできません。Windows 7 64 ビットで VS2010 を使用しています。設定ファイルは次のとおりです。

<configuration>
    <system.serviceModel>
        <bindings>
            <netNamedPipeBinding>
                <binding name="ServiceNameNamedPipeEndPoint" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                    hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
                    maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport protectionLevel="EncryptAndSign" />
                    </security>
                </binding>
            </netNamedPipeBinding>
        </bindings>
        <client>
            <endpoint address="net.pipe://localhost/VirtualDirectoryName/ServiceName.svc"
                binding="netNamedPipeBinding" bindingConfiguration="ServiceNameNamedPipeEndPoint"
                contract="ServiceNameContract" name="ServiceNameNamedPipeEndPoint" />
        </client>
    </system.serviceModel>
</configuration>

ありがとう。

アップデート

私はWSDLを見てきましたが、これを見つけました:

<wsdl:service name="ServiceName">
 <wsdl:port name="ServiceNameNamedPipeEndPoint" binding="i0:ServiceNameNamedPipeEndPoint">
  <soap12:address location="net.pipe://localhost/VirtualDirectoryName/ServiceName.svc"/>
   <wsa10:EndpointReference>
    <wsa10:Address>
net.pipe://localhost/VirtualDirectoryName/ServiceName.svc
   </wsa10:Address>
  </wsa10:EndpointReference>
 </wsdl:port>
</wsdl:service>

名前付きパイプが使用されるバインディングであることを指定しているように思えます。これはもっともらしく聞こえますか?もしそうなら、だれかがこれを WSDL に追加する原因となったアクションまたは設定を提案できますか?

更新 (2)

サービスの構成は次のとおりです。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <appSettings>
    <add key="Logging" value="True" />
    <add key="LogPath" value="c:\Temp\" />
  </appSettings>
  <connectionStrings>
    <add name="MyAppConnectionString" connectionString="Data Source=ReportingServerName\MyApp_UAT;Initial Catalog=MyApp;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.serviceModel>
    <extensions>
      <behaviorExtensions>
        <add name="UnityBehaviorExtension" type="MyDomain.MyApp.Business.Services.Implementations.UnityEndPointBehaviour, MyDomain.MyApp.Business.Services.Libs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf929a8c65660387" />
      </behaviorExtensions>
    </extensions>
    <bindings>
      <netNamedPipeBinding>
        <binding name="NamedPipeBinding" openTimeout="00:05:00" sendTimeout="00:05:00" receiveTimeout="02:00:00">
          <security mode="None">
            <transport protectionLevel="None" />
          </security>
        </binding>
      </netNamedPipeBinding>
      <netTcpBinding>
        <binding name="NetTcpBinding_MyReportsService" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="6553600" maxConnections="10" maxReceivedMessageSize="6553600">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IReportGeneratorService" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_PackageTriggerServiceContract" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IReportGeneratorService" 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="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
        <binding name="MetadataExchangeHttpBinding_IReportGeneratorService" 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="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="">
              <extendedProtectionPolicy policyEnforcement="Never" />
            </transport>
            <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://IntranetServerName:41000/MyDomain.MyApp.Reports.Services.WebHost/MyDomain.MyApp.Reports.Services.Hosts.ReportGeneratorServiceHost.svc/mex" binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_IReportGeneratorService" contract="SvcReference.IReportGeneratorService" name="MetadataExchangeHttpBinding_IReportGeneratorService" />
      <endpoint address="http://IntranetServerName:41000/MyDomain.MyApp.Reports.Services.WebHost/MyDomain.MyApp.Reports.Services.Hosts.ReportGeneratorServiceHost.svc/basic" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IReportGeneratorService" contract="SvcReference.IReportGeneratorService" name="BasicHttpBinding_IReportGeneratorService" />
      <endpoint address="http://ReportingServerName:42500/MyDomain.MyApp.Integration.Services.PackageTriggerService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_PackageTriggerServiceContract" contract="PackageTriggerService.PackageTriggerServiceContract" name="BasicHttpBinding_PackageTriggerServiceContract" />
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="UnityBehaviorExtension">
          <UnityBehaviorExtension />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.REPS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.SRefS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.MyReportsInterfaceService_behaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.DFS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.ServiceName_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementation.FCS_Behaviour">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementation.FCS2_Behaviour">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.BIS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.CS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.W2CS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
        </behavior>
        <behavior name="MyDomain.MyApp.Business.Services.Implementations.TrS_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.REPS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.REPS">
        <clear />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="REPSMexEndPoint" contract="IMetadataExchange" listenUriMode="Explicit" />
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/REPS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="REPSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IREPSContract" listenUriMode="Explicit" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.W2CS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.W2CS">
        <clear />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="W2CSMexEndPoint" contract="IMetadataExchange" listenUriMode="Explicit" />
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/W2CS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="W2CSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IW2CSContract" listenUriMode="Explicit" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.SRefS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.SRefS">
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="SRefSMexEndPoint" contract="IMetadataExchange" />
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/SRefS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="SRefSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.ISRefSContract" listenUriMode="Explicit" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.MyReportsInterfaceService_behaviour" name="MyDomain.MyApp.Business.Services.Implementations.MyReportsService">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_MyReportsService" name="MyReportsServiceNetTcpEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IMyReportsServiceContract" />
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MyReportsServiceMexTcpBindingEndpoint" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:50000/" />
          </baseAddresses>
        </host>
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.DFS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.DFS">
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="DFSMexEndPoint" contract="IMetadataExchange" />
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/DFS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="DFSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IDFSContract" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.ServiceName_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.ServiceName">
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="ServiceNameMexEndPoint" contract="IMetadataExchange" />
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/ServiceName.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="ServiceNameNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IServiceNameContract" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementation.FCS_Behaviour" name="MyDomain.MyApp.Business.Services.Implementations.FCS">
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/FCS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="FCSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IFCSContract" />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="FixedContractMexEndPoint" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementation.FCS2_Behaviour" name="MyDomain.MyApp.Business.Services.Implementations.FCS2">
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/FCS2.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="FCS2NamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IFCS2Contract" />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="FlexContractMexEndPoint" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.BIS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.BIS">
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/BIS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="BISNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IBISContract" />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="BISMexEndPoint" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.CS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.CS">
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/CS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="CSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.ICSContract" />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="CSMexEndPoint" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="MyDomain.MyApp.Business.Services.Implementations.TrS_Behavior" name="MyDomain.MyApp.Business.Services.Implementations.TrS">
        <endpoint address="net.pipe://localhost/MyDomain.MyApp.Business.Services.WebHost/TrS.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="TrSNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.ContractA" />
        <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="TrSMexEndPoint" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="OptionInfer" value="true" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
      </assemblies>
    </compilation>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing, Verbose" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\log\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>

サービスをホストしているサーバーにもアクセスできるようになりました。IIS 6.1 です。

Web サイトの詳細設定で、有効なプロトコルが "http,net.pipe,net.tcp,net.msmq" に設定されています。そのリストに「http」が表示されるとは思っていなかったので、svcutil が名前付きパイプ バインディングのみを生成する理由についてまだ混乱しています。私が欲しいのは、リモートで使用できるバインディングです。これを許可するために何を変更すればよいか分かりますか?

ありがとう。

4

2 に答える 2

2

私はこれを理解しました。

サービス構成の要素に、新しい要素<services>を追加しました。endpoint

 <service>
    <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration="" name="ServiceNameMexEndPoint" contract="IMetadataExchange" />
    <endpoint address="net.pipe://localhost/VirtualDirectoryName/ServiceName.svc" behaviorConfiguration="UnityBehaviorExtension" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="ServiceNameNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IServiceNameContract" />
    <!-- 20/06/2012 added this to let svcutil benerate a non-named pipe binding START-->
        <endpoint address="http://sluat01lonuk.gazpromuk.intra:40000/VirtualDirectoryName/ServiceName.svc" behaviorConfiguration="UnityBehaviorExtension" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServiceName" name="ServiceNameNamedPipeEndPoint" contract="MyDomain.MyApp.Business.Services.Contracts.IServiceNameContract" />
        <!-- 20/06/2012 added this to let svcutil benerate a non-named pipe binding END-->
  </service>

svcutil が名前付きパイプ接続のみを生成していた理由は、代替エンドポイントが公開されていなかったためです。

サービスにこの変更を加えると、WSDL が更新され、新しいエンドポイントが保持されます。その後、svcutil を再実行すると、basicHttpBinding バインディングが output.config に追加されました。

したがって、私の質問に完全かつ明示的に答えるには、リモートサーバーをプロキシするときに svcutil が netNamedPipeBinding を提案する原因は<services>、サービスの構成内の要素に net.pipe のみが含まれendpoint、http (または、net.tcp だと思います) エンドポイントが含まれていない場合です。

これが誰かに役立つことを願っています。

ありがとう。

于 2012-06-20T15:17:31.727 に答える
1

ABCであるWCFサービスには3つのことがあります

A-アドレス-wsdl:serviceセクションで表現され、wsdl:bindingを具体的なサービスエンドポイントアドレスにリンクします

B-バインディング-wsdl:bindingセクションで表現され、wsdl:portTypeコントラクト記述を具体的なトランスポート、エンベロープ形式、および関連するポリシーにバインドします

C-コントラクト-wsdl:portType、wsdl:message、およびwsdl:typeセクションで表現され、タイプ、メッセージ、メッセージ交換パターン、および操作について説明します。

投稿したWSDLのサービスセクションは、サービスがnetNamedPipeBindingに公開されていることを明確に示しています。

しかし、HTTPプロトコル(http:// IntranetServerName:40000 / VirtualDirectoryName / ServiceName.svc?wsdl)でアクセスできる理由がわかりません。

サービスの設定ファイルを見ることができる可能性はありますか?

于 2012-06-19T16:19:32.110 に答える