Catalook Remote API

时间:2013-03-27 20:35:43

标签: web-services dotnetnuke

我正在尝试使用远程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());

我在系统中只有一个订单,但我无法使用此方法查询它。订单已付款。

1 个答案:

答案 0 :(得分: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
}