I try to make a Ubivox subscribtion in Umbraco through Ubivox API, but they only have an example in Python and PHP. Anyone tried to make an integration into C#?
I'm sorry I'm not exactly answering your question, however we currently don't have any examples using C#. Another developer, Bo Mortensen, recently worked on a .NET implentation - maybe you can get input from him? https://twitter.com/bo_mortensen/status/344021666302668800
Then we need a reference in our class file which are going to implement/use this interface, to the CookComputing.XmlRpc (which is already in the Umbraco /bin folder):
using CookComputing.XmlRpc;
Then we can use the interface by utilizing some of the methods, classes and properties of the XmlRpc assembly:
// Create a new proxy using the interface we have defined
var proxy = XmlRpcProxyGen.Create<IUbivox>();
// Authenticate
proxy.Credentials = new NetworkCredential(ubivoxUsername, ubivoxPassword);
// Create a new XmlRpcStruct for the custom data fields on our Ubivox list XmlRpcStruct data = new XmlRpcStruct();
// Fill in custom data fields // First string param is the field alias (found in Ubivox admin section) and last string param is the actual value data.Add("Name", "Bo Damgaard Mortensen");
data.Add("Zipcode", "8930");
data.Add("Company", "uconsult");
data.Add("Member", "Ja"); // Ubivox radiobutton: "Ja" / "Nej" ("Yes" / "No")
data.Add("Gender", "Male");
// Make call to Ubivox to insert a new subscriber with custom data fields var result = proxy.CreateNewSubscriptionWithData("[email protected]", new object[] { "ubivoxListId" }, false, data);
Hope this helps :-)
I am planning to create a C# wrapper/library in august where my holiday starts and build a Razor "API" package for Umbraco to make it easier to integrate Ubivox with C#/ASP.NET/Umbraco.
Anyone tried to implement Ubivox XML-RPC
Hi,
I try to make a Ubivox subscribtion in Umbraco through Ubivox API, but they only have an example in Python and PHP. Anyone tried to make an integration into C#?
Hope someone can help me on this :)
/Niels
Hi Niels,
I'm sorry I'm not exactly answering your question, however we currently don't have any examples using C#. Another developer, Bo Mortensen, recently worked on a .NET implentation - maybe you can get input from him?
https://twitter.com/bo_mortensen/status/344021666302668800
Regards,
David, Ubivox
Hi David,
Yes, I helped Niels implementing it at CodeGarden '13 :-) It was easy to implement using the xml-rpc.net library!
I'll trick Niels into sharing the code here (og perhaps send it to me, so I can paste it) for future reference.
All the best,
Bo
Great to hear - we're looking forward to that! :)
What comes around, goes around ;-)
Here's some source code for the integration:
First, we need to define our interface for the Ubivox methods:
Then we need a reference in our class file which are going to implement/use this interface, to the CookComputing.XmlRpc (which is already in the Umbraco /bin folder):
Then we can use the interface by utilizing some of the methods, classes and properties of the XmlRpc assembly:
Hope this helps :-)
I am planning to create a C# wrapper/library in august where my holiday starts and build a Razor "API" package for Umbraco to make it easier to integrate Ubivox with C#/ASP.NET/Umbraco.
All the best,
Bo
It has taken me a long time to actually get this to work.
I have been in dialog with Bo Damsgaard about this, and we try too get it work, but without result.
I Need the subscribe code in a Razor environment, but it was not possible to implement the interface by Razor, so I get this Assembly to work instead.
First the assembly:
And here is the Razor-script:
Hope other can use my example.
Best regards
Jan Borup Coyle.
is working on a reply...