-1

クライアントには、以下に示すような宛先アドレスがあります。

<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IService1" />
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:8080/ConsoleService/" binding="wsHttpBinding"
                bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1"
                name="WSHttpBinding_IService1">
                <identity>
                    <userPrincipalName value="KIRILL-PC\Кирилл" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

サーバーにはこの構成があります。

    <configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <system.serviceModel>
    <services>
      <service name ="WcfServiceLibrary1.Service1"
               behaviorConfiguration ="ConsoleServiceMEXBehavior">
        <endpoint address ="mex"
                binding ="mexHttpBinding"
                contract ="IMetadataExchange" />
        <endpoint address =""
                  binding ="wsHttpBinding"
                  contract ="WcfServiceLibrary1.IService1" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/ConsoleService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name ="ConsoleServiceMEXBehavior">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

次に、smth を送信しようとしましたが、プログラムでエラーが発生しました

System.ServiceModel.EndpointNotFoundException

ファイアウォールが無効になっており、両方の PC が同じネットワーク上にあります。

これが、私がこの問題を解決するのを手伝ってくれるようお願いする理由です.

4

1 に答える 1