2011-07-15 18 views
1

私はAIF Webサービスを使用して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) 

答えて

0

あなたのMicrosoft Dynamics AXにログオンすることはできません。詳細については、Web サーバーイベントビューアを確認するか、 管理者に問い合わせてください。

あなたはAXユーザーとして作成されていないことがありますか?

管理\セットアップ\セキュリティ\システムサービスアカウント、特に "ビジネスコネクタプロキシ"もチェックしてください。すべてが失敗した場合

は、Webサーバーのログを確認するか、

+0

を試してみて、物事は上の失敗を開始します私はwebservicesを使用して同じマシン。ビジネスコネクタが正常に動作するため、「ビジネスコネクタプロキシ」の設定は正しいです。 –

0

:-)システム管理者に連絡し、私はビジネスコネクタを使用して接続することができ、次の

 AX ax = new AX();//where AX=YourWebServiceClient 

     ax.ChannelFactory.Credentials.UserName.UserName = @"domain\username"; 
     ax.ChannelFactory.Credentials.UserName.Password = @"password"; 

     CallContext context = new CallContext(); 
     context.Company = "YourCompany"; 

     Console.WriteLine(ax.YourServiceFunction(context)); 
関連する問題