void RequestService()
        {
            requestMsgSet.ClearRequests();
            IItemServiceQuery service = requestMsgSet.AppendItemServiceQueryRq();

            responseMsgSet = sessionManager.DoRequests(requestMsgSet);
            IResponse response = responseMsgSet.ResponseList.GetAt(0);

            if (response.StatusCode >= 0)
            {
                //the request-specific response is in the details, make sure we have some
                if (response.Detail != null)
                {
                    //make sure the response is the type we're expecting
                    ENResponseType responseType = (ENResponseType)response.Type.GetValue();
                    if (responseType == ENResponseType.rtItemServiceQueryRs)
                    {
                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                        IItemServiceRetList ItemServiceRetList = (IItemServiceRetList)response.Detail;
                        int count = ItemServiceRetList.Count;
                        if (count > 0)
                        {
                            ItemList = new List <Items>();
                        }
                        for (int a = 0; a < count; a++)
                        {
                            ItemList.Add(WalkServiceItem(ItemServiceRetList.GetAt(a)));
                        }
                    }
                }
            }
            else
            {
                //  throw new QBException(response.StatusCode, response.StatusMessage.ToString(), requestMsgSet.ToXMLString());
            }
        }
Beispiel #2
0
        void BuildItemServiceQueryRq(IMsgSetRequest requestMsgSet)
        {
            IItemServiceQuery ItemServiceQueryRq = requestMsgSet.AppendItemServiceQueryRq();

            //Set attributes
            //Set field value for metaData

            ItemServiceQueryRq.metaData.SetAsString("IQBENmetaDataType");
            //Set field value for iterator
            ItemServiceQueryRq.iterator.SetAsString("IQBENiteratorType");
            //Set field value for iteratorID
            ItemServiceQueryRq.iteratorID.SetValue("IQBUUIDType");
            string ORListQueryWithOwnerIDAndClassElementType42 = "ListIDList";

            if (ORListQueryWithOwnerIDAndClassElementType42 == "ListIDList")
            {
                //Set field value for ListIDList
                //May create more than one of these if needed
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListIDList.Add("200000-1011023419");
            }
            if (ORListQueryWithOwnerIDAndClassElementType42 == "FullNameList")
            {
                //Set field value for FullNameList
                //May create more than one of these if needed
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.FullNameList.Add("ab");
            }
            if (ORListQueryWithOwnerIDAndClassElementType42 == "ListWithClassFilter")
            {
                //Set field value for MaxReturned
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.MaxReturned.SetValue(6);
                //Set field value for ActiveStatus
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ActiveStatus.SetValue(ENActiveStatus.asActiveOnly);
                //Set field value for FromModifiedDate
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.FromModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"), false);
                //Set field value for ToModifiedDate
                ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ToModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"), false);
                string ORNameFilterElementType43 = "NameFilter";
                if (ORNameFilterElementType43 == "NameFilter")
                {
                    //Set field value for MatchCriterion
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ORNameFilter.NameFilter.MatchCriterion.SetValue(ENMatchCriterion.mcStartsWith);
                    //Set field value for Name
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ORNameFilter.NameFilter.Name.SetValue("ab");
                }
                if (ORNameFilterElementType43 == "NameRangeFilter")
                {
                    //Set field value for FromName
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ORNameFilter.NameRangeFilter.FromName.SetValue("ab");
                    //Set field value for ToName
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ORNameFilter.NameRangeFilter.ToName.SetValue("ab");
                }
                string ORClassFilterElementType44 = "ListIDList";
                if (ORClassFilterElementType44 == "ListIDList")
                {
                    //Set field value for ListIDList
                    //May create more than one of these if needed
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ClassFilter.ORClassFilter.ListIDList.Add("200000-1011023419");
                }
                if (ORClassFilterElementType44 == "FullNameList")
                {
                    //Set field value for FullNameList
                    //May create more than one of these if needed
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ClassFilter.ORClassFilter.FullNameList.Add("ab");
                }
                if (ORClassFilterElementType44 == "ListIDWithChildren")
                {
                    //Set field value for ListIDWithChildren
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ClassFilter.ORClassFilter.ListIDWithChildren.SetValue("200000-1011023419");
                }
                if (ORClassFilterElementType44 == "FullNameWithChildren")
                {
                    //Set field value for FullNameWithChildren
                    ItemServiceQueryRq.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.ClassFilter.ORClassFilter.FullNameWithChildren.SetValue("ab");
                }
            }
            //Set field value for IncludeRetElementList
            //May create more than one of these if needed
            ItemServiceQueryRq.IncludeRetElementList.Add("ab");
            //Set field value for OwnerIDList
            //May create more than one of these if needed
            ItemServiceQueryRq.OwnerIDList.Add(Guid.NewGuid().ToString());
        }