API肥皂连接中的C#缺少字段

时间:2019-02-19 16:11:44

标签: c# api web-services soap wsdl

我正在尝试将api集成到商店的购物网站中,以将账单信息,名称等获取到程序。我已经能够连接到soap Web服务,但是某些参数返回null。相同的代码适用于Java,但是在C#中我遇到了一些问题。  您是否知道问题出在哪里或出了什么问题。  任何帮助表示赞赏。

 // api location https://api.n11.com/ws/OrderService.wsdl
    String strAppKey = "***"; // api key
    String strAppSecret = "***"; // api password
    String strStartDate = "15.09.2016";
    String strEndDate = "15.09.2019";
    String strOrderStatus = "New"; // 
    String strRecipient = "";
    String strBuyerName = "";
    String strOrderNumber = "";
    String strProductSellerCode = "";
    long productIdValue = 0;
    int currentPageValue = 0;
    int pageSizeValue = 10;
    Authentication authentication = new Authentication();
    authentication.appKey = strAppKey;
    authentication.appSecret =strAppSecret;

    OrderSearchPeriod orderSearchPeriod = new OrderSearchPeriod();
    orderSearchPeriod.startDate =strStartDate;
    orderSearchPeriod.endDate =strEndDate;
    OrderDataListRequest orderDataListRequest = new OrderDataListRequest();
    orderDataListRequest.productSellerCode =strProductSellerCode;
    orderDataListRequest.recipient =strRecipient;
    orderDataListRequest.period =orderSearchPeriod;
    orderDataListRequest.buyerName =strBuyerName;
    orderDataListRequest.productId =productIdValue;
    orderDataListRequest.orderNumber =strOrderNumber;
    orderDataListRequest.status =strOrderStatus;
    RequestPagingData pagingData = new RequestPagingData();
    pagingData.currentPage =currentPageValue;
    pagingData.pageSize =pageSizeValue;
    OrderListRequest1 request = new OrderListRequest1();
    request.OrderListRequest = new OrderListRequest();
    request.OrderListRequest.auth = authentication;
    request.OrderListRequest.pagingData = pagingData;
    request.OrderListRequest.searchData = orderDataListRequest;      
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    OrderServicePort port =new OrderServicePortClient();        
    OrderListResponse1 response = port.OrderList(request);

0 个答案:

没有答案