我正在使用AIF webservices連接到Microsoft Dynamics AX 2009.爲VS2010中的服務生成代理,但是當我想使用生成客戶端類連接到服務時,似乎我沒有在系統中進行身份驗證。使用AIF webservices連接到Microsoft Dynamics AX 2009
我甚至嘗試添加域用戶名/密碼,並使用Windows身份驗證,像這樣:
var binding = new BasicHttpBinding();
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
var address = new EndpointAddress(new Uri("http://dynamicsserver/salesorderservice.svc"));
var client = new SalesOrderServiceClient(binding, address);
client.ClientCredentials.Windows.ClientCredential = new NetworkCredential("admin", "pass", "domain);
默認綁定是HttpBinding,我試圖使用運行一個控制檯應用程序連接到AIF使用同一臺機器上的NetworkCredential中指定的相同帳戶。
我收到以下錯誤,當應用程序連接到web服務:
System.ServiceModel.FaultException: You cannot log on to Microsoft Dynamics AX.. Error details: Unable to log on to Microsoft Dynamics AX.. Check the Web server event viewer for more information, or contact your Administrator. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
我可以使用業務連接器連接,但做起事情來就失敗了同一臺機器,當我使用web服務。 「業務連接器代理」設置是正確的,因爲業務連接器正常工作。 –