Web services 尝试访问GP Web服务时出现SOAP异常

Web services 尝试访问GP Web服务时出现SOAP异常,web-services,microsoft-dynamics,dynamics-gp,Web Services,Microsoft Dynamics,Dynamics Gp,我正在尝试编写一个程序,该程序只需连接到一个GP web服务并调用它的GetCustomerList()方法即可从Great Plains获得客户。下面我概述的代码是我在文档中找到的代码的副本,但是,当我运行它时,我得到了一个SoapException。我不确定我是否丢失了凭据(例如用户名和密码),或者我是否正确调用了它。我相信我已在Dynamics安全控制台中正确设置了安全设置,但我不能100%确定是否还有其他需要配置的内容。任何帮助都将不胜感激 public IList<string&

我正在尝试编写一个程序,该程序只需连接到一个GP web服务并调用它的GetCustomerList()方法即可从Great Plains获得客户。下面我概述的代码是我在文档中找到的代码的副本,但是,当我运行它时,我得到了一个SoapException。我不确定我是否丢失了凭据(例如用户名和密码),或者我是否正确调用了它。我相信我已在Dynamics安全控制台中正确设置了安全设置,但我不能100%确定是否还有其他需要配置的内容。任何帮助都将不胜感激

public IList<string> GetCustomerNames()
{
    //Added a ServiceReference to the actual WebService which appears to be working
    var service = new DynamicsGPClient();
    var context = new Context();
    var customerKey = new CustomerKey();
    var companyKey = new CompanyKey();

    //Trying to load the test data
    companyKey.Id = (-1);

    context.OrganizationKey = (OrganizationKey)companyKey;

    //Trying to load the test data
    customerKey.Id = "AARONFIT0001";

    var customers = service.GetCustomerList(new CustomerCriteria(), context);

    return customers.Select(x => x.Name).ToList();
}
public IList GetCustomerNames()
{
//将ServiceReference添加到实际的Web服务,该Web服务似乎正在工作
var service=new DynamicsGPClient();
var context=新上下文();
var customerKey=new customerKey();
var companyKey=新companyKey();
//正在尝试加载测试数据
companyKey.Id=(-1);
context.OrganizationKey=(OrganizationKey)companyKey;
//正在尝试加载测试数据
customerKey.Id=“aarnfit001”;
var customers=service.GetCustomerList(新CustomerCriteria(),上下文);
return customers.Select(x=>x.Name).ToList();
}

听起来像是安全问题。。。您是否收到特定的错误消息。。。这可能会有帮助

还发现了这个

在我看来,您的计算机上需要Windows应用程序池标识 网络服务。现在您已将IIS安全设置为“匿名”,因此 客户端调用您的方法时不需要传递凭据

您需要将其关闭,并以windows帐户运行应用程序池。一旦 你可以选择是否只添加一个应用程序 将标识汇集到Web服务的安全性中,并拥有所有操作 作为该帐户完成(安全性差),或者,在您的包装中,您可以使用 HTTP用户的上下文标识,并将其设置为 您实际使用的GP Web服务调用

你必须给这个应用 web服务安全中的池标识“of”权限 控制台,然后是要调用Web服务的用户。这保持 安全模型完好无损,您正在授权调用 wrapped webservice实际上拥有调用原始GP的权限 Webservice方法。(这就是业务门户将请求转发给 网络服务。)


我正在使用Dynamics GP 2010。