Client endpoint configuration '*' was not found at 1 endpoint, WCF, Mono

Guys guys

I am trying to access a web service hosted in a virtual machine (Windows 7) from my Ubuntu host using Mono.

I can import the wdsl file and generate a service link. I copied App.config from another working client that accessed the web service correctly.

When I try to connect to a web service using the system;

namespace MonoTest
{
class MainClass
{
    public static void Main (string[] args)
    {
        Console.WriteLine ("Hello World!");
        TestServer.Service1Client client = new TestServer.Service1Client("Test");
        Console.WriteLine(client.GetData(12));
        Console.ReadLine();
    }
}
}

I get an error message:

System.InvalidOperationException: Client endpoint configuration 'Test' was not found in 1 endpoints.
  at System.ServiceModel.ChannelFactory.ApplyConfiguration (System.String endpointConfig) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.ChannelFactory.InitializeEndpoint (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.ChannelFactory`1[MonoTest.TestServer.IService1]..ctor (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.ClientBase`1[MonoTest.TestServer.IService1].Initialize (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.ClientBase`1[MonoTest.TestServer.IService1]..ctor (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.ClientBase`1[MonoTest.TestServer.IService1]..ctor (System.String endpointConfigurationName) [0x00000] in <filename unknown>:0 
  at MonoTest.TestServer.Service1Client..ctor (System.String endpointConfigurationName) [0x00000] in <filename unknown>:0 
  at MonoTest.MainClass.Main (System.String[] args) [0x0000a] in /home/***/WebserviceTest/MonoTest/MonoTest/Main.cs:11 

My App.config file looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IService1" />
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint name="Test"
                address="http://192.168.178.34:8732/Design_Time_Addresses/TestServer/Service1/"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
                contract="ServiceReference1.IService1" >
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

Has anyone done this using Linux?

+5
source share
2 answers

Mono WSDL , app.config.

, , , WCF .

, Visual Studio Mono , .

Visual Studio app.config. " ", <endpoint ... contract="contract name"> Reference.cs.

Visual Studio

    [ServiceContractAttribute(ConfigurationName="contract name")]
    public interface YourContract {
            ....
    }

ConfigurationName , <endpoint ... contract="...">, WCF .

Mono, ,

    [ServiceContractAttribute]
    public interface YourContract {
            ....
    }

ConfigurationName .

, app.config <endpoint ... contract="...">.

contract="ServiceReference1.IService1" contract="TestServer.IService1".

Reference.cs, [ServiceContractAttribute] # .

+7

Mono WCF dotnet WCF, :

,

WSHttpBinding     TransactionFlow     ReliableSession

, : http://www.mono-project.com/WCF_Development

0

All Articles