Would appreciate help with the above error. We're using MailChimpAmazon.SES.SesApi.SendEmail and from the stacktrace it looks like JSON formatted data should be returned. However the call to SendEmail fails with the "Encountered unexpected character '<'" message, perhaps indicating an XML response?
This started happening today at 12 noon (UTC/GMT +1 hour).
Any clues?
System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type MailChimpAmazon.SES.Results.SendEmailResult. Encountered unexpected character '<'. ---> System.Xml.XmlException: Encountered unexpected character '<'.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, XmlException exception)
at System.Runtime.Serialization.Json.XmlJsonReader.ReadAttributes()
at System.Runtime.Serialization.Json.XmlJsonReader.Read()
at System.Xml.XmlBaseReader.IsStartElement()
at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalIsStartObject(XmlReaderDelegator reader)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
--- End of inner exception stack trace ---
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(Stream stream)
at Hammock.Serialization.HammockDataContractJsonSerializer.Deserialize[T](String content) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\Serialization\HammockDataContractJsonSerializer.cs:line 59
at Hammock.RestClient.DeserializeEntityBody[T](RestBase request, RestResponse`1 response) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 2302
at Hammock.RestClient.BuildResponseFromResult[T](RestBase request, WebQuery query) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 2214
at Hammock.RestClient.Request[T](RestRequest request) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\RestClient.cs:line 107
at MailChimpAmazon.SES.SesApi.SendEmail(String subject, String htmlMessage, String textMessage, EmailAddress fromEmail, IEnumerable`1 toEmailAddresses, IEnumerable`1 replyToEmails, Boolean trackOpens, Boolean trackClicks, IEnumerable`1 tags)
...
Best regards,
Fredrik
Thanks Jesse. Yes we are on us1 (http://us1.sts.mailchimp.com/1.0/).
It seems we are no longer seeing the "Encountered unexpected character" problem but instead we have a lot of 400 Bad Request and occasionally a few 500 Internal Server Error. What is the most common cause of 400 Bad Request? Any changes in parameters on your side?
Stacktrace below.
MailChimpAmazon.SES.ApiException: MailChimp Amazon SES Wrapper Exception ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
at Hammock.Web.WebQuery.ExecutePostOrPut(PostOrPut method, String url, WebException& exception) in D:\My Dropbox\_7_Source_Code\_1_Projects\hammock\src\net35\Hammock\Web\WebQuery.cs:line 1117
--- End of inner exception stack trace ---
at MailChimpAmazon.SES.SesApi.checkForError(RestResponseBase response) in [...]\MailChimpAmazon.SES\src\MailChimpAmazonSES_b6d6e306fad0\SesApi.cs:line 253
at MailChimpAmazon.SES.SesApi.SendEmail(String subject, String htmlMessage, String textMessage, EmailAddress fromEmail, IEnumerable`1 toEmailAddresses, IEnumerable`1 replyToEmails, Boolean trackOpens, Boolean trackClicks, IEnumerable`1 tags)
Best regards,
Fredrik
jesse
--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To post to this group, send email to mailchimp-...@googlegroups.com.
To unsubscribe from this group, send email to mailchimp-api-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mailchimp-api-discuss?hl=en.
In the logs for the 400 Bad Request calls I can find the following response body:
{"aws_type":"Sender","aws_code":"MessageRejected","http_code":400,"message":"Address blacklisted."}
This happens with TO email addresses of ordinary people, seemingly randomly. The FROM email address is a "noreply" address for the site in question, and it's the same address as in all other calls that take place (there are lots more of them and they succeed).
The 500 Internal Server Error calls are much rarer and don't pose the same problems to us. But here is an example of such a response body:
{"aws_type":null,"aws_code":null,"http_code":500,"message":"A backend database error occurred. Reference code: ebcf222dc5e77b6"}