Tag Archives: wcf

How to pass a Dictionary<Key, Value> from C# to PHP

I believe that the simplest way to pass complex data from C# to PHP is through WCF service. See my previous post How to implement WCF service in PHP for more details.

Let assume we have a WCF service contract that has the following method with some nested dictionary as a parameter:

public interface IStore
    void UpdateRows(Dictionary<int, Dictionary<string, object>> rows);

Below I provided the sample implementation of UpdateRows in PHP that iterates through nested dictionaries (first level called ‘rows’ and second level called ‘properties’):


How to implement WCF service in PHP

Today I implemented my first PHP Web Service and successfully used it by C# client or, more precisely, I created WCF service contract in C# and implemented it in PHP.  A new option “singlewsdl” in WCF 4.5  helped me a lot. Using this option I generated the service description as a single WSDL-file without additional XSD-files containing the data contracts of the service. Then I uploaded this WSDL-file on my Web Server and written PHP code for all the methods of the service.


Integrating C# and PHP using XML-RPC and WCF

While investigating how to make C# and PHP interact with each other I run into an interesting extension of WCF Service Model for working over XML-RPC protocol. I played a bit with this extension and after fixing some bug in its source code I made it work with my little custom XML-RPC server implemented as Joomla XML-RPC plugin.