none
How to generate service interface from wsdl file and its implementation class to host Mock Service? RRS feed

  • Question

  • I want to create a mocking service framework for Soap and Rest Services. I'm able to read WSDL file contents (Operations, input parameter, and return type ) in c# code. Now I want to create a service contract at runtime and implement it in class that will be hosted. For Reference I used SOAPUI.SOAPUI creates service contract at runtime and hosts mock service. I want to do the same in C#. Any Idea of how to do it?
    Wednesday, April 10, 2019 5:38 AM

All replies

  • I want to create <g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="10" id="10"><g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="12" id="12">mockingservice</g></g> framework for Soap and Rest Services. I'm able to read WSDL file contents (Operations, input <g class="gr_ gr_11 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="11" id="11">parameterreturn</g> type ) in c# code. Now I want to create a service contract at runtime and implement it in class that will be hosted (). For Reference I used <g class="gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="14" id="14">SOAPUI .</g>SOAPUI creates service contract at runtime and <g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="13" id="13">host</g> mock service. I want to do <g class="gr_ gr_23 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="23" id="23">same</g> in C#. Any <g class="gr_ gr_32 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="32" id="32">Idea</g> how to do it?

    Maybe, you can cleanup your post so that it is readable.
    Wednesday, April 10, 2019 6:21 AM
  • Its cleaned up now. Please help me!
    Wednesday, April 10, 2019 10:50 AM
  • Hi Mr. Akshay G,

    I could not get your point, Do you mean that you want to dynamically create a service contract which you get from the specified WSDL and implement it(at runtime), and host it to create the WCF service.

    As far as I know, if we want to create a service contract at runtime, it is a complex task. refer to the below links.

    https://weblogs.asp.net/andresv/dynamic-runtime-generation-of-a-wcf-service-contract

    would you mind sharing how do you achieve it in SOAP UI?

    Regards

    Abraham

    Friday, April 12, 2019 3:28 AM
    Moderator