/**
         * Returns the RequestType of the request, as set in the MarketplaceWebService attribute.
         * If the attribute is missing from the request, it is assumed that the request type
         * is RequestType.DEFAULT.
         */
        private RequestType GetMarketplaceWebServiceRequestType(Type type)
        {
            if (type == null || type == typeof(object))
            {
                return(RequestType.DEFAULT);
            }

            MarketplaceWebServiceAttribute attribute = (MarketplaceWebServiceAttribute)
                                                       Attribute.GetCustomAttribute(type, typeof(MarketplaceWebServiceAttribute));

            return(attribute.RequestType);
        }
        /**
         * Examines the request type and determines if the MarketplaceWebService attribute
         * has the ResponseType set to ResponseType.STREAMING. The response from the service
         * will be written to the stream marked with the MarketplaceWebServiceStream attribute.
         */
        private bool ExpectStreamingResponse(Type type)
        {
            if (type == null)
            {
                return(false);
            }

            MarketplaceWebServiceAttribute attribute = (MarketplaceWebServiceAttribute)
                                                       Attribute.GetCustomAttribute(type, typeof(MarketplaceWebServiceAttribute));

            if (attribute == null)
            {
                return(false);
            }
            else
            {
                return(attribute.ResponseType == ResponseType.STREAMING);
            }
        }