programmatically setting the URI to a web service
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.

Post a new message to this list...

Cral Almodovar
is there a way to set at run-time the uri/url to a web service?
i tried modifying the proxy class generated by vs.net - i added a
constructor that accepts a string containing the URL. it worked,
but there's a warning in a comment block at the top of the the
auto-generated class that it shouldn't be modified. can anybody
suggest an alternative ?

thanks.

Reply to this message...
 
    
Alexei
proxy.Url = "string"

--
--Alexei
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ¿ 2001 Microsoft Corporation. All rights
reserved.

"Cral Almodovar" <Click here to reveal e-mail address> wrote in message
news:uBmcsLoSBHA.1404@tkmsftngp03...
[Original message clipped]

Reply to this message...
 
    
Cral Almodovar
thanks, i was aware of that. but i can only set the url property *after* the
url has already been set by the default constructor. i tried adding an
alternate
constructor that accepts a url, but whenever i refresh the proxy class,
the constructor i added is removed from the code (actually there's a warning
in a comment block at the top of the auto-generated class that says
something
about not modifying the auto-generated code).
i've used the ms soap toolkit before, and it was easier to move the web
service around, because you simply pass the url to the the soapclient
object's
mssoapinit() method. any other suggestion?

"Alexei" <Click here to reveal e-mail address> wrote in message
news:3bba77e5$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Matt Griffith
On Wed, 3 Oct 2001 13:40:04 +0800, Cral Almodovar
<Click here to reveal e-mail address> wrote...
[Original message clipped]

Cral,

Check out the URL Behavior property of the Web Reference for the service
you are interested in. Change it to Dynamic and you can then set the URL
via the app.config file.

As far as I know, that is the only way to control the URL on a web
service proxy that is being controlled by the IDE. There are a many ways
you could get around this if you want to manually code/manage the web
service proxy.

Matt Griffith
Reply to this message...
 
    
Cral Almodovar
thanks a lot matt, that was what i needed!

"Matt Griffith" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Chandu Thota
In fact you can hand code the proxy without using WSDL.EXE. All you
need to do is derive a class from the classes below
SoapHttpClientProtocol for SOAP
HttpGetClientProtocol for HTTP-GET
HttpPostClientProtocol for HTPP-POST
And then you can design your own "proxy" the way you need!

Hope this helps! Let me know if you need more info!

Chandu Thota
www.csthota.com
Reply to this message...
 
 
System.Web.Services.Protocols.HttpGetClientProtocol
System.Web.Services.Protocols.HttpPostClientProtocol
System.Web.Services.Protocols.SoapHttpClientProtocol




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com