seb*_*ibu 4 c# wcf unity-game-engine
我有一些wcf webservices,我在IIS上托管在localhost上.我希望能够从Unity3d访问它们但我在播放场景时收到以下错误:
InvalidOperationException: Client endpoint configuration 'BasicHTTPEndpoint' was not found in 0 endpoints.
System.ServiceModel.ChannelFactory.ApplyConfiguration (System.String endpointConfig)
System.ServiceModel.ChannelFactory.InitializeEndpoint (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress)
System.ServiceModel.ChannelFactory`1[IUnityStore]..ctor (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress)
System.ServiceModel.ClientBase`1[TChannel].Initialize (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress)
System.ServiceModel.ClientBase`1[TChannel]..ctor (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName)
System.ServiceModel.ClientBase`1[TChannel]..ctor (System.String endpointConfigurationName)
UnityStoreClient..ctor (System.String endpointConfigurationName)
firstCall.Start () (at Assets/Scripts/firstCall.cs:8)
Run Code Online (Sandbox Code Playgroud)
Web服务实例化如下:
UnityStoreClient uc = new UnityStoreClient("BasicHTTPEndpoint");
uc.Open(); //i don't know if i need this ?????
UnityStoreLibrary.User[] users = uc.GetAllUsers("1",null);
for (int i=0;i<users.Length;i++)
Debug.Log("username = " + users[i].username);
Run Code Online (Sandbox Code Playgroud)
我的脚本文件夹中有一个配置文件,但我不知道我是否应该使用它.我使用svcutil
Visual Studio 2010 创建了Unity类.
使用System.ServiceModel;
我的课程实现中缺少此声明.
我这样称呼webservice:
UnityStoreClient client = new UnityStoreClient(new BasicHttpBinding(), new EndpointAddress(some_url));
Run Code Online (Sandbox Code Playgroud)