Link to home
Start Free TrialLog in
Avatar of borghard
borghard

asked on

Initialize a proxy class with a url from a C++ application


I created a C# web service application that is being consumed by a C++ application. I added the web Service as a web reference to the C++ application. I want to be able to pass in the url for the web service when I instantiate the web service in the C++ application.
I tried inheriting from the proxy class but did not have access to its Url property, so what do I have to do to gain access to the Url property of the proxy class?

Thanks
 
Avatar of Axter
Axter
Flag of United States of America image

It would help if you post the class declaration for the class you're referring to.

If you need to get a data member value, then you should add a method to the class, that will return the value you're trying to retrieve.
>>I tried inheriting from the proxy class but did not have access to its Url property

Seems that your non-public members in the base class are declared as 'private', not as 'protected'...
Avatar of borghard
borghard

ASKER

The base class is the proxy class,  It gets generated from my web service it seems that I don't have access to this Url porperty even within my web service.
The following is a declaration of the web service:
public class Service1 : System.Web.WebService
      {
            public Service1()
            {
                  //CODEGEN: This call is required by the ASP.NET Web Services Designer
                  InitializeComponent();
                  //this.
            }
}

So my question what class does my service have to inherit from to gain access to the Url property.
I did see in some book an example of changing the Url property of a web service that inherits from the following class: System.Web.Services.Protocols.SoapHttpClientProtocol
when I tried inheriting from that class I was able to see the Url property but only within the service itself, it did not show up in the proxy class, so I had no access to it from the C++ application so How do I gain access to this property?
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial