Solved

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

Posted on 2004-10-27
201 Views
Last Modified: 2010-04-01

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
 
0
Question by:borghard
    6 Comments
     
    LVL 30

    Expert Comment

    by:Axter
    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.
    0
     
    LVL 86

    Expert Comment

    by:jkr
    >>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'...
    0
     

    Author Comment

    by:borghard
    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.
    0
     
    LVL 86

    Expert Comment

    by:jkr
    0
     

    Author Comment

    by:borghard
    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?
    0
     

    Accepted Solution

    by:
    PAQed with points refunded (250)

    modulo
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
    This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now