我有一些wcf web服務,我託管在本地主機上的IIS。 我希望能夠從Unity3d訪問它們,但我得到以下錯誤,當我播放的場景:從unity3D消費WCF
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)
的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);
我有一個配置文件我腳本文件夾,但我不知道我是否應該使用它。我使用Visual Studio 2010中的svcutil
創建了統一類。
我應該在哪裏把這個web.config文件? –
它應該放在與您進行web服務調用的程序集相同的目錄中。 –
我用'svcutil'生成的類在Scripts \ ClientProxies中。我也有一些DLL的插件目錄:System.Runtime.Serialization,System.Security,System.ServiceModel。彙編目錄在哪裏?我的配置文件被稱爲web.config。 –