I am writing a C# .NET app in Microsoft Visual Studio 2008 to access the CampaignMonitor web service. I obtained the SOAP API from "http://api.createsend.com/api/api.asmx?wsdl" and had MSVC autogenerate an api class from it.
But, oddly enough, it decided to implement CreateCampaign with return type "object" instead of "Result". And I've found out that if my CreateCampaign call succeeds, then it returns a string object set to the campaign ID, but if the call fails, then it returns a Result object with the Code and Message set to describe the problem.
I don't know why it isn't returning a Result object in both cases, as the documentation says it should.
Has anyone else seen this behavior? Is this a problem with the API definition, or with the way that MSVC autogenerated the class?
Good question, and you'll hopefully be pleased to know that we've just updated the Campaign.Create documentation as a result.
The Campaign.Create procedure is like List.Create and Client.Create in that a successful call will return a string with the newly created ID. Error conditions will produce a Result.