/// <summary>
 ///
 /// </summary>
 /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
 public GetMemberMessagesCall(ApiContext ApiContext)
 {
     ApiRequest      = new GetMemberMessagesRequestType();
     this.ApiContext = ApiContext;
 }
 /// <summary>
 ///
 /// </summary>
 public GetMemberMessagesCall()
 {
     ApiRequest = new GetMemberMessagesRequestType();
 }
		/// <summary>
		/// 
		/// </summary>
		/// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
		public GetMemberMessagesCall(ApiContext ApiContext)
		{
			ApiRequest = new GetMemberMessagesRequestType();
			this.ApiContext = ApiContext;
		}
    public GetMemberMessagesResponseType GetTransactionMessages(string itemID, string BuyerID, string userToken)
    {
        string callname = "GetMemberMessages";

        #region Initialise Needed Variables

        //Get the Server to use (Sandbox or Production)
        string serverUrl = ConfigurationManager.AppSettings["TradingService"];

        //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
        //string siteID = "0";

        eBayAPIInterfaceService service = new eBayAPIInterfaceService();
        string requestURL = serverUrl + "?callname=" + callname + "&siteid=" + siteID
                            + "&appid=" + AppID + "&version=" + version + "&routing=default";
        service.Url = requestURL;

        // Set credentials
        service.RequesterCredentials = new CustomSecurityHeaderType();
        service.RequesterCredentials.Credentials = new UserIdPasswordType();
        service.RequesterCredentials.Credentials.AppId = AppID;
        service.RequesterCredentials.Credentials.DevId = DevID;
        service.RequesterCredentials.Credentials.AuthCert = CertID;
        service.RequesterCredentials.eBayAuthToken = userToken;
        #endregion

        GetMemberMessagesRequestType request = new GetMemberMessagesRequestType();
        request.MailMessageType = MessageTypeCodeType.All;
        request.MailMessageTypeSpecified = true;
        request.WarningLevel = WarningLevelCodeType.High;
        request.MessageStatus = MessageStatusTypeCodeType.Unanswered;
        request.MessageStatusSpecified = true;
        request.ItemID = itemID;
        if (BuyerID != string.Empty)
            request.SenderID = BuyerID;
        request.Version = version;

        try
        {
            GetMemberMessagesResponseType response = service.GetMemberMessages(request);
            return response;
        }
        catch (Exception ex)
        {
            if (ex.Message.ToLower().Contains("auth token"))
                throw new InvalidEbayCredentialsException();
            else
                throw ex;
        }
    }
		/// <summary>
		/// 
		/// </summary>
		public GetMemberMessagesCall()
		{
			ApiRequest = new GetMemberMessagesRequestType();
		}