简体   繁体   English

使用 AIF Web 服务连接到 Microsoft Dynamics AX 2009

[英]Using AIF webservices to connect to Microsoft Dynamics AX 2009

I'm using AIF webservices to connect to Microsoft Dynamics AX 2009. Proxies are generated for the service in VS2010, but when I want to connect to the service using generate client class, it seems I am not authenticated in the system.我正在使用 AIF Web 服务连接到 Microsoft Dynamics AX 2009。在 VS2010 中为服务生成了代理,但是当我想使用生成客户端 class 连接到服务时,似乎我没有在系统中进行身份验证。

I even tried adding a domain user/pass and use windows authentication, like this:我什至尝试添加域用户/通行证并使用 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);

Default binding is HttpBinding, and I'm trying to connect to the AIF using a console application that is running using the same account specified in NetworkCredential on the same machine.默认绑定是 HttpBinding,我正在尝试使用控制台应用程序连接到 AIF,该控制台应用程序使用同一台计算机上的 NetworkCredential 中指定的相同帐户运行。

I get the following error when application connects to the webservice:应用程序连接到 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)

Try the following尝试以下

        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));

You are unable to log on to Microsoft Dynamics AX.您无法登录到 Microsoft Dynamics AX。 Check the Web server event viewer for more information, or contact your Administrator.查看 Web 服务器事件查看器以获取更多信息,或联系您的管理员。

Maybe you do not have been created as an AX user?也许您还没有被创建为 AX 用户?

Also check Administration\Setup\Security\System service accounts especially the "Business connector proxy".还要检查 Administration\Setup\Security\System 服务帐户,尤其是“业务连接器代理”。

If all fails, check the logs of your web server or contact your system administrator:-)如果全部失败,请检查您的 web 服务器的日志或联系您的系统管理员:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在指定的超时时间00:01:00-使用AIF / WCF的AX 2012中,打开操作未完成 - The open operation did not complete within the allotted timeout of 00:01:00 - AX 2012 using AIF/WCF 动态ax部署WCF服务 - dynamics ax deploy WCF service 在验证我的 wcf 服务中的 AX 服务器域、用户名和密码等凭据后,下载 Microsoft Dynamics AX 2012 服务 wsdl 元数据 - Download Microsoft Dynamics AX 2012 service wsdl metadata after validating credentials like AX server domain, user name and password in my wcf service Dynamics AX 2012 R2:使用Web服务WCF启动PO批准工作流 - Dynamics AX 2012 R2: Initiate PO approve workflow using a web service, WCF WCF(Dynamics AX)-服务发送的大多数属性为null - WCF (Dynamics AX) - Service sending most properties null 如何在Dynamics AX中获得SOAP故障的详细信息? - How do I get the details of a SOAP fault in Dynamics AX? 结合使用PetaPoco和Web服务 - Using PetaPoco with webservices 无法使用SOAP客户端访问AIF Web服务 - Unable to access AIF web service using SOAP Client 如何在不使用VS的情况下从Dynamics AX中的c#项目刷新wcf服务引用 - How to refresh a wcf service reference from c# project in Dynamics AX without VS 如何使用新字段扩展我的 WCF 服务(Dynamics AX 2012)? - How can I extend my WCF Service with new fields (Dynamics AX 2012)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM