HEJ家伙,客户端点配置“*”在1个端点,WCF没有被发现,单
我试图访问托管的虚拟机上的Web服务(Windows 7)中,从我的Ubuntu主机使用单声道。
我可以导入wdsl文件并生成服务引用。我从正在访问web服务的其他工作客户端复制App.config。
当我尝试使用系统连接到使用 的webservice;
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();
}
}
}
我得到一个错误:
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
我App.config文件看起来如下:
<?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>
有没有人做这个用Linux工作?
谢谢,问题实际上是那个老,我不再寻找解决方案。但感谢你的帮助! – Sebastian