Click to See Complete Forum and Search --> : How to create a SOAP interface from the .NET DLL?


Philipina
March 18th, 2008, 10:41 AM
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.

http://www.BiereMaison.be/images/DLL_english.jpg

Tron
March 18th, 2008, 11:29 AM
You may be able to do this using WCF (Windows Communication Foundation) but that requires .NET 3.0.

Arjay
March 18th, 2008, 11:35 AM
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.

Philipina
March 19th, 2008, 01:59 AM
Ok, than I think that my only option is to start creating a webService around my DLL.

Remi,

Philipina
March 20th, 2008, 02:16 AM
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.

nelo
March 20th, 2008, 03:48 AM
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#

[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 :)

Philipina
March 20th, 2008, 04:31 AM
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.

nelo
March 20th, 2008, 05:13 AM
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# (http://msdn2.microsoft.com/en-us/library/87h5xz7x(VS.80).aspx)