Wcf 无法使用SOAP客户端访问AIF web服务

Wcf 无法使用SOAP客户端访问AIF web服务,wcf,axapta,soap-client,dynamics-ax-2012,aif,Wcf,Axapta,Soap Client,Dynamics Ax 2012,Aif,我创建了一个测试项目,其中包含表、数据/服务合同类以及服务和服务组,如下所示: 部署之后,我甚至能够使用.Net控制台应用程序访问和查看GetEntityList数据 ServiceReference1. EntityServiceClient _Client = new ServiceReference1.EntityServiceClient(); ServiceReference1. CallContext _CallContext = new ServiceReference1.Call

我创建了一个测试项目,其中包含表、数据/服务合同类以及服务和服务组,如下所示:

部署之后,我甚至能够使用.Net控制台应用程序访问和查看GetEntityList数据

ServiceReference1.
EntityServiceClient _Client = new ServiceReference1.EntityServiceClient();
ServiceReference1.
CallContext _CallContext = new ServiceReference1.CallContext();
_CallContext.Company =
"dat";
ServiceReference1.
CustomEntityDataContract[] _entityList = _Client.GetEntityList(_CallContext);
// ColorServiceGroup.ColorDC _Dc ;
foreach (ServiceReference1.CustomEntityDataContract _Dc in _entityList)
{
Console.WriteLine(_Dc.EntityName);
}
Console.ReadKey();
问题是我需要使用SOAP客户端访问它,尝试创建大量SOAP信封消息,但无法查看服务数据。 我想我可能缺少的是SOAP头中正确的身份验证标记,我不知道,请指定

到目前为止,我尝试过的标题如下:

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
    <a:Action s:mustUnderstand="1">http://schemas.microsoft.com/dynamics/2008/01/services/EntityService/GetEntityList</a:Action>
    <h:CallContext i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:h="http://schemas.microsoft.com/dynamics/2010/01/datacontracts" />
    <a:ReplyTo>
    <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
  </s:Header>
  <s:Body>
    <EntityServiceGetEntityListRequest xmlns="http://tempuri.org" />
  </s:Body>
</s:Envelope>
更新: 正如我提到的,我可以使用.Net控制台应用程序访问web服务,但当我使用Visual Studio命令行工具>WCFTestClient>添加服务时,它也不起作用。它不允许在那里添加服务,并给出以下错误:

中不存在类型或命名空间名称“Application” 命名空间“Microsoft.Dynamics.Ax”是否缺少程序集 参考文献


任何帮助都将不胜感激。

不赞成直接与SOAP通信的方法,而现在通过添加服务引用将其成功地用于.NET控制台应用程序。可以获取、插入记录。

如果尝试,会发生什么?你有例外吗?它说什么?在Firefox SOA客户端上尝试过,它返回的WSDL文档与我在没有请求的情况下只点击url得到的相同body@MartinDráb您能确认所有呼叫都需要身份验证吗?我没有在控制台应用程序中提供任何身份验证详细信息,它正在工作,并返回ax表中的实体列表。