0

我正在尝试使用远程 API 从 Catalook 中提取订单。这是我的代码:

    CATALooKRemote.RemoteController remote = new CATALooKRemote.RemoteController();
    remote.Url = "http://localhost/Customers/DotNetNuke_Community_06.02.04_Install/DesktopModules/CATALooKStore/remote.asmx";
    bool log = remote.Login(0, "host", "dnnhost");
    Response.Write(log);
    var orders = remote.GetOrders(new DateTime(2009, 1, 1), new DateTime(2014, 1, 1), -1);
    foreach (var a in orders)
    {

    }

    //throws null reference exception
    Response.Write(orders.Count());

我的系统中只有一个订单,但是我无法使用这种方法查询它。订单已付款状态。

4

1 回答 1

0

我从未使用过 CATALookRemote 服务,但查看 WSDL,您不需要传递用户名、密码和门户 ID 吗?

SRVRemote.RemoteControllerSoapClient remote = new SRVRemote.RemoteControllerSoapClient();
List<SRVRemote.OrderDetailsRemote> oOrders = null;
oOrders = remote.GetOrders(System.DateTime.FromOADate(0), System.DateTime.Today, -1, 0, "MyUsername", "MyPassword");
foreach (SRVRemote.OrderDetailsRemote order in oOrders) {
    //Do something
}
于 2013-03-27T21:03:04.637 回答