I think I may have to take back my original idea - it certainly looks like it would work in theory, but I was doing some testing, and it looks like unless I have a method that matches exactly to my web service's method, it throws a fit a runtime. There might still be a way, but it's probably not as easy as I originally thought. The request/response idea seems pretty sound, so if you don't have a static WSDL to use, that may be the way to go.
But if you do have the same signatures across your URLs, and you know these at compile-time, then WSDL and a proxy class is definitely the fastest and easiest way to get this done. On Sep 10, 7:52 am, Joe Enos <[EMAIL PROTECTED]> wrote: > In my implementation, I use a WSDL-generated codefile as a base class, > named MyService_Base. In its constructor, it has the following line, > representing wherever it pulled the info from: > this.Url = "http://www.url.com/servicename.asmx"; > > I then have a non-auto-generated codefile with class named MyService, > that derives from MyService_Base. In this class, I have a new > constructor that sets the Url property to whatever's in my config > file. I use this class to compile and run against. This same > technique can be used, with a new constructor that accepts the service > URL as a string at runtime. > > As long as your class derives from SoapHttpClientProtocol and have all > of your logic there, you should be able to manipulate the Url, method > names, and event handlers all at runtime. > > On Sep 9, 11:53 pm, Cerebrus <[EMAIL PROTECTED]> wrote: > > > Joe... I wasn't aware of this... can you elaborate upon how the URL of > > a webservice instance (using the Proxy class method) can be > > dynamically changed during Runtime? > > > On Sep 10, 11:45 am, Joe Enos <[EMAIL PROTECTED]> wrote: > > > > If I understand your issue, you just want to call a web service method > > > without pre-compiling the signatures for the methods. This shouldn't > > > be a problem. If you take a look at the auto-generated code after > > > running WSDL on a sample service, you'll see what a request actually > > > does - just calls things like: > > > return this.BeginInvoke("MyMethodName",, new object[] {...) > > > and other methods for each method in the web service. You should be > > > able to set the Url property at runtime, and call the appropriate > > > methods yourself, just by passing in the method name and parameters. > > > > On Sep 9, 1:46 pm, Cale <[EMAIL PROTECTED]> wrote: > > > > > Hello group, > > > > > I've been digging around Google and the rest of the Internet for the > > > > last few days trying to figure out how to consume a web service > > > > without using a proxy class. Everything that turns up uses some type > > > > of proxy class and that won't work for me... mainly because I won't > > > > know the endpoints or web services to consume until later during > > > > runtime. > > > > > I've been porting some Java code related to web services recently. In > > > > the Java code there's calls into Apache Axis to get the job done (for > > > > both providing and consuming). Is there anything similar to that > > > > in .NET? Or Is there at least some type of SOAP client class I can use > > > > to create and send a request in .NET? > > > > > Perhaps I should focus my searches on SOAP instead of "Web services"? > > > > > Thanks in advance.- Hide quoted text - > > > > - Show quoted text - > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
