Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:16:47+00:00 2026-06-08T13:16:47+00:00

I’ve got a custom HTTP server built in C# which accepts requests for REST

  • 0

I’ve got a custom HTTP server built in C# which accepts requests for REST services and responds with XML or JSON (depending on what the client needs). The REST services are defined at runtime from a database-based configuration, vary widely in input parameters and output types, and it’s working beautifully in production.

However, I’d like to add SOAP access to the same services, with appropriate WSDLs as well. Since the available services aren’t hard-coded, this means:

  • Publishing a WSDL generated at runtime from the method definitions in the database
  • Parsing incoming SOAP requests, mapping them to those definitions, and making sure the requests conform to the method signature before handling them
  • Once the response is handled, creating a SOAP response meeting the WDSL to return the results

The MS documentation (and Google) documents using Visual Studio to generate web services (and WSDLs) at design time, exposing stuff using WebMethods, ASP.NET MVC etc. This isn’t what I’m looking for, as there are no method definitions from which to generate the bindings at design time.

Does anyone have any ideas (e.g. toolkits for raw SOAP parsing), and thoughts on generation of WSDLs from dynamically created method signatures, etc? Any idea how one might go about building such things if not? I’m looking to avoid re-inventing the wheel if possible.

PS: Clearly there’s standardised stuff in the .NET framework for this, since Visual Studio does it for you – any ideas how to access that at a lower level, at runtime?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:16:49+00:00Added an answer on June 8, 2026 at 1:16 pm

    To create a wsdl dynamically you can use ServiceDescriptionReflector

    For example: for class

    public class TestWebService
    {
        [WebMethod]
        public string Hello(string namex)
        {
            return "Hello " + namex;
        }
    }
    

    you can use this code

    StringWriter wr = new StringWriter();
    var r = new System.Web.Services.Description.ServiceDescriptionReflector();
    r.Reflect(typeof(TestWebService), "http://somewhere.com");
    r.ServiceDescriptions[0].Write(wr);
    var wsdl = wr.ToString();
    

    But since you’ve said

    Publishing a WSDL generated at runtime from the method definitions in the database

    you have to create the Type at runtime

    var asm = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("MyAsm"), AssemblyBuilderAccess.Run);
    var mod = asm.DefineDynamicModule("MyModule");
    
    TypeBuilder typeBuilder = mod.DefineType("TestWebService");
    
    MethodBuilder mb = typeBuilder.DefineMethod("Hello", MethodAttributes.Public, CallingConventions.Standard, typeof(string), new Type[] { typeof(string) });
    var cab = new CustomAttributeBuilder( typeof(WebMethodAttribute).GetConstructor(new Type[]{}), new object[]{} );
    mb.SetCustomAttribute(cab);
    mb.DefineParameter(1, ParameterAttributes.In, "namex");
    mb.GetILGenerator().Emit(OpCodes.Ret);
    
    Type type = typeBuilder.CreateType();
    

    Now you can use type to create wsdl

    StringWriter wr = new StringWriter();
    var r = new System.Web.Services.Description.ServiceDescriptionReflector();
    r.Reflect(type, "http://somewhere.com");
    r.ServiceDescriptions[0].Write(wr);
    var wsdl = wr.ToString();
    

    For reading request and forming response, you can use Linq2Xml. Fiddler can give you an idea about SOAP(xml) format sent between client and server

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have a text area in my form which accepts all possible characters from
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.