This may help you get started. A great article from Roman Kiss on
CodeProject demonstrates programmatically reading WSDL and dynamically
generating in memory a proxy class that can be used to exercise methods. I
wrote a short snippet to test it below.
The key is the ServiceDescription class, at least, it's the starting point.
---------------- WebServiceAccessor.cs starts ----------------------------
Go to Roman's excellent article on The Code Project at:
http://www.thecodeproject.com/cs/webservices/webservicecallback.asp then
look for the code snippet titled WebServiceAccessor.
---------------- WebServiceAccessor.cs ends ------------------------------
---------------- ExeWSDL.cs starts ----------------------------
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Net;
namespace ExeWSDL
{
public class WSDLExecuter
{
public static void Main(string [] args)
{
WebServiceAccessor ac = new
WebServiceAccessor("
http://www.mccomsoft.com/Test.asmx?wsdl");
object esObj = ac.CreateInstance("Test");
//string sProgramArguments = "";
object retval = ac.Invoke(esObj, "TestResponse", null);
Console.WriteLine((string) retval);
}
}
}
---------------- ExeWSDL.cs ends ------------------------------
Build with:
csc -out:ExeWSDL.exe ExeWSDL.cs WebServiceAccessor.cs
Dilton
Madjid Nasiri said:
Hi Scott and other reader,
I have to write a program for call any webservice, this program must get
webservice's wsdl and show a xform for geting parameters and then send
parameter to webservice and show result.
How can send a SOAP message to a webservice? I wrote my program in asp.net
and C#.
Thanks for help, special scott.