dynamic creation of web service proxy...

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default dynamic creation of web service proxy...

    I know this has probably been asked a lot but I can't find any good exmaples
    so....

    Can anyone give some url's to C# code that dynaimcally generates a web
    service proxy at runtime?

    Cheers

    Ollie Riches
    [url]http://www.phoneanalyser.net[/url]


    Disclaimer: Opinions expressed in this forum are my own, and not
    representative of my employer.
    I do not answer questions on behalf of my employer. I'm just a programmer
    helping programmers.




    Ollie Riches Guest

  2. Similar Questions and Discussions

    1. Dynamic Input Creation via Data Service???
      Ok, Sorry I am a noob with Flex, but I have a lot of experience in other UI development. If someone has already asked this question then I...
    2. Proxy Shared Object Creation Difficulty
      I am having difficulty creating a proxy shared object. The instance folder gets created but it doesn't seem like data gets put into the shared...
    3. dynamic xml creation
      How can I make XML dynamically inside tha Flash using AS? Basicly i need to make structure like these one: <root> <item></item> ......
    4. dynamic tag creation
      Looking for a way to dynamically evaluate a tag from a string. eg: <cfset tmp = '<cfset myRslt = "Hello">'> <cfoutput> #tmp# </cfoutput> ...
    5. dynamic object creation
      If I have something like this: s="Array" How whould I get something like this: aObject=s.new In "plain" english I am asking if I have a...
  3. #2

    Default Re: dynamic creation of web service proxy...

    Ollie,

    You will want to use the SoapHttpClientProtocol class. It will allow
    you to make late-bound calls to SOAP services. As a matter of fact, when
    you create proxies in VS.NET, the classes derive from this, and all method
    calls actually package up calls to the Invoke method on the same class.

    Hope this helps.

    --
    - Nicholas Paldino [.NET/C# MVP]
    - [email]mvp@spam.guard.caspershouse.com[/email]

    "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    news:%23Rlk3BodFHA.2124@TK2MSFTNGP14.phx.gbl...
    >I know this has probably been asked a lot but I can't find any good
    >exmaples so....
    >
    > Can anyone give some url's to C# code that dynaimcally generates a web
    > service proxy at runtime?
    >
    > Cheers
    >
    > Ollie Riches
    > [url]http://www.phoneanalyser.net[/url]
    >
    >
    > Disclaimer: Opinions expressed in this forum are my own, and not
    > representative of my employer.
    > I do not answer questions on behalf of my employer. I'm just a programmer
    > helping programmers.
    >
    >
    >
    >

    Nicholas Paldino [.NET/C# MVP] Guest

  4. #3

    Default Re: dynamic creation of web service proxy...

    'Still the fast answer in the west' :)

    Thanks

    Ollie

    "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
    message news:%23fKBUFodFHA.3932@TK2MSFTNGP12.phx.gbl...
    > Ollie,
    >
    > You will want to use the SoapHttpClientProtocol class. It will allow
    > you to make late-bound calls to SOAP services. As a matter of fact, when
    > you create proxies in VS.NET, the classes derive from this, and all method
    > calls actually package up calls to the Invoke method on the same class.
    >
    > Hope this helps.
    >
    > --
    > - Nicholas Paldino [.NET/C# MVP]
    > - [email]mvp@spam.guard.caspershouse.com[/email]
    >
    > "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    > news:%23Rlk3BodFHA.2124@TK2MSFTNGP14.phx.gbl...
    >>I know this has probably been asked a lot but I can't find any good
    >>exmaples so....
    >>
    >> Can anyone give some url's to C# code that dynaimcally generates a web
    >> service proxy at runtime?
    >>
    >> Cheers
    >>
    >> Ollie Riches
    >> [url]http://www.phoneanalyser.net[/url]
    >>
    >>
    >> Disclaimer: Opinions expressed in this forum are my own, and not
    >> representative of my employer.
    >> I do not answer questions on behalf of my employer. I'm just a
    >> programmer
    >> helping programmers.
    >>
    >>
    >>
    >>
    >
    >

    Ollie Riches Guest

  5. #4

    Default Re: dynamic creation of web service proxy...

    Ollie,

    I'm actually in NYC, so from a local perspective, I'm in the east...


    --
    - Nicholas Paldino [.NET/C# MVP]
    - [email]mvp@spam.guard.caspershouse.com[/email]

    "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    news:%23uRGLNodFHA.1504@TK2MSFTNGP15.phx.gbl...
    > 'Still the fast answer in the west' :)
    >
    > Thanks
    >
    > Ollie
    >
    > "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
    > in message news:%23fKBUFodFHA.3932@TK2MSFTNGP12.phx.gbl...
    >> Ollie,
    >>
    >> You will want to use the SoapHttpClientProtocol class. It will allow
    >> you to make late-bound calls to SOAP services. As a matter of fact, when
    >> you create proxies in VS.NET, the classes derive from this, and all
    >> method calls actually package up calls to the Invoke method on the same
    >> class.
    >>
    >> Hope this helps.
    >>
    >> --
    >> - Nicholas Paldino [.NET/C# MVP]
    >> - [email]mvp@spam.guard.caspershouse.com[/email]
    >>
    >> "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    >> news:%23Rlk3BodFHA.2124@TK2MSFTNGP14.phx.gbl...
    >>>I know this has probably been asked a lot but I can't find any good
    >>>exmaples so....
    >>>
    >>> Can anyone give some url's to C# code that dynaimcally generates a web
    >>> service proxy at runtime?
    >>>
    >>> Cheers
    >>>
    >>> Ollie Riches
    >>> [url]http://www.phoneanalyser.net[/url]
    >>>
    >>>
    >>> Disclaimer: Opinions expressed in this forum are my own, and not
    >>> representative of my employer.
    >>> I do not answer questions on behalf of my employer. I'm just a
    >>> programmer
    >>> helping programmers.
    >>>
    >>>
    >>>
    >>>
    >>
    >>
    >
    >

    Nicholas Paldino [.NET/C# MVP] Guest

  6. #5

    Default Re: dynamic creation of web service proxy...

    that's west of here :)

    Ollie

    "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
    message news:u12lQQodFHA.3032@TK2MSFTNGP10.phx.gbl...
    > Ollie,
    >
    > I'm actually in NYC, so from a local perspective, I'm in the east...
    >
    >
    > --
    > - Nicholas Paldino [.NET/C# MVP]
    > - [email]mvp@spam.guard.caspershouse.com[/email]
    >
    > "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    > news:%23uRGLNodFHA.1504@TK2MSFTNGP15.phx.gbl...
    >> 'Still the fast answer in the west' :)
    >>
    >> Thanks
    >>
    >> Ollie
    >>
    >> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
    >> in message news:%23fKBUFodFHA.3932@TK2MSFTNGP12.phx.gbl...
    >>> Ollie,
    >>>
    >>> You will want to use the SoapHttpClientProtocol class. It will allow
    >>> you to make late-bound calls to SOAP services. As a matter of fact,
    >>> when you create proxies in VS.NET, the classes derive from this, and all
    >>> method calls actually package up calls to the Invoke method on the same
    >>> class.
    >>>
    >>> Hope this helps.
    >>>
    >>> --
    >>> - Nicholas Paldino [.NET/C# MVP]
    >>> - [email]mvp@spam.guard.caspershouse.com[/email]
    >>>
    >>> "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    >>> news:%23Rlk3BodFHA.2124@TK2MSFTNGP14.phx.gbl...
    >>>>I know this has probably been asked a lot but I can't find any good
    >>>>exmaples so....
    >>>>
    >>>> Can anyone give some url's to C# code that dynaimcally generates a web
    >>>> service proxy at runtime?
    >>>>
    >>>> Cheers
    >>>>
    >>>> Ollie Riches
    >>>> [url]http://www.phoneanalyser.net[/url]
    >>>>
    >>>>
    >>>> Disclaimer: Opinions expressed in this forum are my own, and not
    >>>> representative of my employer.
    >>>> I do not answer questions on behalf of my employer. I'm just a
    >>>> programmer
    >>>> helping programmers.
    >>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

    Ollie Riches Guest

  7. #6

    Default Re: dynamic creation of web service proxy...

    Yes, but since the planet is round, doesn't that mean that if you go far
    enough west, you will eventually be east (and vice versa)?
    "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    news:uqOWdtodFHA.720@TK2MSFTNGP15.phx.gbl...
    > that's west of here :)
    >
    > Ollie
    >
    > "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
    > in message news:u12lQQodFHA.3032@TK2MSFTNGP10.phx.gbl...
    >> Ollie,
    >>
    >> I'm actually in NYC, so from a local perspective, I'm in the east...
    >>
    >>
    >> --
    >> - Nicholas Paldino [.NET/C# MVP]
    >> - [email]mvp@spam.guard.caspershouse.com[/email]
    >>
    >> "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    >> news:%23uRGLNodFHA.1504@TK2MSFTNGP15.phx.gbl...
    >>> 'Still the fast answer in the west' :)
    >>>
    >>> Thanks
    >>>
    >>> Ollie
    >>>
    >>> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
    >>> in message news:%23fKBUFodFHA.3932@TK2MSFTNGP12.phx.gbl...
    >>>> Ollie,
    >>>>
    >>>> You will want to use the SoapHttpClientProtocol class. It will
    >>>> allow you to make late-bound calls to SOAP services. As a matter of
    >>>> fact, when you create proxies in VS.NET, the classes derive from this,
    >>>> and all method calls actually package up calls to the Invoke method on
    >>>> the same class.
    >>>>
    >>>> Hope this helps.
    >>>>
    >>>> --
    >>>> - Nicholas Paldino [.NET/C# MVP]
    >>>> - [email]mvp@spam.guard.caspershouse.com[/email]
    >>>>
    >>>> "Ollie Riches" <ollie.riches@phoneanalyser.net> wrote in message
    >>>> news:%23Rlk3BodFHA.2124@TK2MSFTNGP14.phx.gbl...
    >>>>>I know this has probably been asked a lot but I can't find any good
    >>>>>exmaples so....
    >>>>>
    >>>>> Can anyone give some url's to C# code that dynaimcally generates a web
    >>>>> service proxy at runtime?
    >>>>>
    >>>>> Cheers
    >>>>>
    >>>>> Ollie Riches
    >>>>> [url]http://www.phoneanalyser.net[/url]
    >>>>>
    >>>>>
    >>>>> Disclaimer: Opinions expressed in this forum are my own, and not
    >>>>> representative of my employer.
    >>>>> I do not answer questions on behalf of my employer. I'm just a
    >>>>> programmer
    >>>>> helping programmers.
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

    Nicholas Paldino [.NET/C# MVP] Guest

  8. #7

    Default Re: dynamic creation of web service proxy...

    [url]www.thinktecture.com[/url] has some code that does this though it needs
    amending for reference and out parameters. Also I am having problems
    with it working when anonymous access is turned off.

    if you figure out how to set credentials on this dynamically created
    proxy, let me know

    phancey@2bytes.co.uk Guest

  9. #8

    Default RE: dynamic creation of web service proxy...

    Ollie,
    Been down that road :( Unfortunately, there's not many googlets out there
    with help on this and related topics. Here is some (modified) code I wrote to
    do this. I also included a few other useful lines which set credentials,
    timeouts, and connection limits. I hope it helps.

    John

    public ServiceInit()
    {


    MyService WebService = new MyService();

    RegistryKey hklm = Registry.LocalMachine;
    RegistryKey hkNterWeb = hklm.OpenSubKey(@"SOFTWARE\MyApp\WebService");
    RegistryKey hkConfiguration = hkNterWeb.OpenSubKey(@"Configuration");

    WebService.Url = (String) hkConfiguration.GetValue("WebServiceURL");
    ServiceTimeout = int.Parse((String)
    hkConfiguration.GetValue("WebServiceTimeout"));
    ServiceConnections = int.Parse((String)
    hkConfiguration.GetValue("WebServiceConnections")) ;
    hklm.Close();

    WebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    WebService.Timeout = ServiceTimeout;

    HttpWebResponse res = null;
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create (WebService.Url);
    res = (HttpWebResponse)req.GetResponse ();
    ServicePoint currentServicePoint = req.ServicePoint;
    currentServicePoint.MaxIdleTime = ServiceTimeout;
    currentServicePoint.ConnectionLimit = ServiceConnections;

    }


    "Ollie Riches" wrote:
    > I know this has probably been asked a lot but I can't find any good exmaples
    > so....
    >
    > Can anyone give some url's to C# code that dynaimcally generates a web
    > service proxy at runtime?
    >
    > Cheers
    >
    > Ollie Riches
    > [url]http://www.phoneanalyser.net[/url]
    >
    >
    > Disclaimer: Opinions expressed in this forum are my own, and not
    > representative of my employer.
    > I do not answer questions on behalf of my employer. I'm just a programmer
    > helping programmers.
    >
    >
    >
    >
    >
    John Hanson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139