Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on defining URL in a Web Proxy Class
Message
From
07/11/2002 12:59:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Question on defining URL in a Web Proxy Class
Miscellaneous
Thread ID:
00719934
Message ID:
00719934
Views:
61
This is a follow-up to a question that I posted a few months ago.

We have a WinForm interface that communicates with a Web Service, which in turn communicates with the middle-tier. We pass datasets back and forth for parameters, result sets, etc.

The Web server URL is configurable, and is defined/set at runtime. So I have a 'stub' web reference class that I created on my local drive that's part of the Winform app...but I need to redefine the URL at runtime to access the 'real' web server.

I received an answer that Adding a Web Reference generates a proxy class, with the contents of the Web Services WSDL file. In this proxy class, inside the New constructor, there's the service URL:

Public Sub New()
...
Me.Url = "http://server/service/service.asmx"
End Sub


The problem is, I don't know specifically how to 'access' this. When I add the web reference, I can't seem to locate the proxy class where I can redefine the URL.

If I bypass all that, and try a ....

MyService.Service1 mytest = new MyService.Service1;
mytest.Url = "new url";
DsReturn = mytest.PerformRequest(DsRemoteInfo);

I get an error message..."object reference not set to instance of an object"


Now...if at design time, I explicitly add the 'real' web reference, it works fine. But I doubt I can do that in a production environment...yet when I add my 'stub' and then try to set the URL just prior to using it, I get the error I just described.

I'm sure I'm missing a step somewhere...so where specifically do I need to set the URL? By the way, I'm using C#, if that makes a difference.

Thanks,
Kevin



Next
Reply
Map
View

Click here to load this message in the networking platform