Esempio n. 1
0
        /// <summary>
        /// Gets the pick list lookup.
        /// </summary>
        /// <param name="lookupType"></param>
        /// <returns></returns>
        /// <exception cref="ApiException">
        /// Error calling SOAP service.  See <see cref="ApiException.Content"/> for more information.
        /// </exception>
        private async Task <IList <LookupValue> > GetPicklistKeywordsAsync(LookupType lookupType)
        {
            var request = new GetPicklistKeywordsRequest(lookupType);

            // create the correct SOAP Envelope for the request
            string soapRequest = request.CreateSoapRequest();

            try
            {
                // make SOAP request and get the response SOAP Envelope
                string soapResponse = await _client.GetPicklistKeywordsAsync(soapRequest);

                GetPicklistKeywordsResponse response = new GetPicklistKeywordsResponse();
                response.LoadFromXml(soapResponse);

                return(response.Values);
            }
            catch (ApiException e)
            {
                throw new SoapFaultException(e);
            }
        }
Esempio n. 2
0
        public void WriteToXml_generates_valid_xml()
        {
            GetPicklistKeywordsRequest sut = new GetPicklistKeywordsRequest(LookupType.LeadAgencyDeptList);

            var xml = sut.CreateSoapRequest();
        }