CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2007
    Posts
    5

    How to create a SOAP interface from the .NET DLL?

    Hello,

    Bonjour,
    I'm newbie in .NET (I usually program in Java ).
    I have received the source code of a .NET DLL (framework 2.0) and I need to migrate the functionality of this DLL into a serveur application written in Java.
    To do this I will modify the DLL (written in .NET) to forward all function calls into SOAP requests to my Java Soap application.
    The only problem is that this DLL interface is quiet huge and if I can generate a WSDL file from the DLL definition this will help me to save a lot of time.
    Then, I'm wondering if there is any possibility to generate a WSDL file from the DLL source code I have.
    I don't know if you understand what I mean, this is not so easy to explain... Here below you will find a picture which should help you to understand my problem.
    In blue you will see the existing part and in red you will see the part I have to develop.

    Thanks in advance for your helps.

    Remi.

    Last edited by Philipina; March 18th, 2008 at 10:45 AM.

  2. #2
    Join Date
    May 2002
    Posts
    511

    Re: How to create a SOAP interface from the .NET DLL?

    You may be able to do this using WCF (Windows Communication Foundation) but that requires .NET 3.0.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to create a SOAP interface from the .NET DLL?

    Code:
    Question: Is it possible to generate the WSDL file from the source code that I have?
    If the .net dll is hosted and exposed by a web service, yes; otherwise, no.

  4. #4
    Join Date
    Feb 2007
    Posts
    5

    Unhappy Re: How to create a SOAP interface from the .NET DLL?

    Ok, than I think that my only option is to start creating a webService around my DLL.

    Remi,

  5. #5
    Join Date
    Feb 2007
    Posts
    5

    Re: How to create a SOAP interface from the .NET DLL?

    I have started integrating DLL functions into a webservice and for some functions I get an error saying : .....cannot be serialized because it does not have a parameterless constructor

    For example with the code
    ---------------------------------------------
    <WebMethod()> _
    Public Function Connect(ByVal conParam As ConnectionDLL.ConnectionParameters) As Boolean
    ...
    Return True
    End Function
    --------------------------------------------

    I get

    ConnectionDLL.ConnectionParameters cannot be serialized because it does not have a parameterless constructor.

    Does any one of you know how to solve this problem?

    Thanks in advance for your help.

    Remi.

  6. #6
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: How to create a SOAP interface from the .NET DLL?

    Do you have the source code for the Connection.dll? It appears you've got a class there called ConnectionParameters. What you are seeking to do is to develop Xml web services right? That means that all the data types that appear in the interface (web methods) should be fit for xml serialisation. One of the constraints for a class it that it must have the default parameterless constructor otherwise it wont be serializable. Here's an example in C#
    Code:
    [Serializable]
    public class ConnectionParameters
    {
       // this is the parameterless constructor
       public ConnectionParameters()
       {
       }
    }
    By the way are writing your web services in VB.NET? I've got nothing against but I would have thought you'd find the C# syntax easier on they eye

  7. #7
    Join Date
    Feb 2007
    Posts
    5

    Re: How to create a SOAP interface from the .NET DLL?

    Ok, thanks I understand now.

    you'd find the C# syntax easier on they eye ....
    Yes, but I did not find any example showing how to create a webService in C# with .NET framework 2.0

    Do you know where can I find such exmaple.

  8. #8
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: How to create a SOAP interface from the .NET DLL?

    I'm sure there are many examples out there but I would start with MSDN library. Here's a link to one of their articles...

    Walkthrough: Creating XML Web Services using Visual Basic or Visual C#

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured