Search code examples
c#web-serviceswcfsoapwsdl

Create dynamic WCF service?


I've got stuck with creating a dynamic WCF service to update an old service created manually by XMLWriter, I want to bring the whole solution to standard WCF.

I've found a solution on ingebrigtsen.info to create a dynamic service but problem is the old service have methods that return result as array of records, but in this solution I have to define a constant type as return type, I can't even create a static record type, because there is many runtime generated methods that have different set of properties.

<soap:Body>
<getcdrResponse xmlns="http://tempuri.org/">
  <getcdrResult>
    <_SID>16111250</_SID>
    <Destination>9392191436</Destination>
    <callTime>0</callTime>
    <pulse>19</pulse>
    <Duration>19</Duration>
    <price>0</price>
    <Name>test</Name>
  </getcdrResult>
  <getcdrResult>
   .....

I think there's a way to write an inspector on output, but I don't know if it's the answer.

My question is: What is the best answer to have a dynamic ResultSet as return in dynamically created WCF method?


Solution

  • After searching about a week I've found a solution to implement what I wanted.
    I wrote an article on Create dynamic WCF service in C# it's not a complete answer but it solved my problem.

    Hope you enjoy