Showing posts with label ExactTarget. Show all posts
Showing posts with label ExactTarget. Show all posts


ExactTarget Error: No results were received from the ExactTarget API

If you are working on extensive integration with ExactTarget from Dynamics CRM, then you might come accross this error message:


"Error during send processing." "ExactTarget.MSCRM4.BusinessLogic.Connector.ExactTargetSendException: No results were received from the ExactTarget API. Send status is unknown. ---> ExactTarget.MSCRM4.BusinessLogic.Connector.ExactTargetSendException: No results were received from the ExactTarget API. Send status is unknown.
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.SendToExactTarget(Send send, Int32 recipientCount)
--- End of inner exception stack trace ---
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.SendToExactTarget(Send send, Int32 recipientCount)
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.Execute()
"

This error occures if you are creating an et_exacttargetjob (Exact Target Send) record by using a system user who is not an ExactTarget user. Make sure you are setting the owner attribute of the Exact Target Send record to the correct user.

It's just a short tip, but since by the time of posting this can't be found by any popular search engine, I'm sure that this will help you, or myself in the future.



Retrieving emails from ExactTarget based on a folder

There are some interesting documentation issues with regards to ExactTarget. For instance, if you are programming against ExactTarget to retrieve all emails which belong to a specific folder, then you would expect that you can filter on the 'folder' attribute of an email. Apparently that doesn't work, but you will have to use the CategoryID attribute. But then again, filtering against the CategoryID doesn't filter the result on the folder.

According to ExactTarget:
There is a known issue with the MSCRM integrated accounts when using a Simple Filter Part on CategoryId via the API. You can use sfp.Property=”fkCategoryid’ and that should work. So you can above method or as a workaround, you can do the filtering in the client application (so your application once you retrieve all the data).

So far the theoretical information. Now the useful summary:


public ArrayList GetEmails(int folderId)
{
// Intialize variables
String requestID;
APIObject[] results;

// Create Filter
SimpleFilterPart sfp = new SimpleFilterPart();
sfp.Property = "fkCategoryID";
sfp.SimpleOperator = SimpleOperators.equals;
sfp.Value = new string[] { folderId.ToString() };

// Create RetrieveRequest
RetrieveRequest rr = new RetrieveRequest();
rr.QueryAllAccounts = true;
rr.QueryAllAccountsSpecified = true;
rr.ObjectType = "Email";
rr.Properties = new string[] { "Name", "ID", "CategoryID" };
rr.Filter = sfp;

// Execute RetrieveRequest
String status = _exactTarget.Retrieve(rr, out requestID, out results);

ArrayList alEmail = new ArrayList();
for (int i = 0; i < results.Length; i++)
{
Email email = (Email)results[i];
alEmail.Add(email);
}
return alEmail;
}



Error: End element 'Fault' from namespace '' expected

When connecting to a WSE 3.0 service, like ExactTarget, you might encounter this exception:


"End element 'Fault' from namespace 'http://www.w3.org/2003/05/soap-envelope' expected. Found element 'detail' from namespace ''

This does basically mean that the soap version of the client doesn't match the server. You might be able to change this in the web.config. For ExactTarget they require you to add a custom binding to the webconfig which specifies the soap version. This is the piece which ExactTarget asks developers to add to their web.config:

<customBinding>
<binding name="SoapBinding">
<security authenticationMode="UserNameOverTransport"></security>
<textMessageEncoding messageVersion="Soap12WSAddressingAugust2004"/>
<httpsTransport/>
/binding>
</customBinding>

In this binding you can easily change the messageVersion to "Soap11WSAddressingAugust2004". This will cause the message to be read correctly.