473,788 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
http://www.phoneanalyser.net
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.


Nov 17 '05 #1
7 1762
Ollie,

You will want to use the SoapHttpClientP rotocol 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]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
http://www.phoneanalyser.net
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.

Nov 17 '05 #2
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Ollie,

You will want to use the SoapHttpClientP rotocol 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]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
http://www.phoneanalyser.net
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.


Nov 17 '05 #3
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Ollie,

You will want to use the SoapHttpClientP rotocol 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]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
http://www.phoneanalyser.net
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.



Nov 17 '05 #4
that's west of here :)

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:u1******** ******@TK2MSFTN GP10.phx.gbl...
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Ollie,

You will want to use the SoapHttpClientP rotocol 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]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
http://www.phoneanalyser.net
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.




Nov 17 '05 #5
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" <ol**********@p honeanalyser.ne t> wrote in message
news:uq******** *****@TK2MSFTNG P15.phx.gbl...
that's west of here :)

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:u1******** ******@TK2MSFTN GP10.phx.gbl...
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Ollie,

You will want to use the SoapHttpClientP rotocol 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]
- mv*@spam.guard. caspershouse.co m

"Ollie Riches" <ol**********@p honeanalyser.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP14.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
> http://www.phoneanalyser.net
>
>
> 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.
>
>
>
>



Nov 17 '05 #6
www.thinktecture.com 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

Nov 17 '05 #7
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.LocalM achine;
RegistryKey hkNterWeb = hklm.OpenSubKey (@"SOFTWARE\MyA pp\WebService") ;
RegistryKey hkConfiguration = hkNterWeb.OpenS ubKey(@"Configu ration");

WebService.Url = (String) hkConfiguration .GetValue("WebS erviceURL");
ServiceTimeout = int.Parse((Stri ng)
hkConfiguration .GetValue("WebS erviceTimeout") );
ServiceConnecti ons = int.Parse((Stri ng)
hkConfiguration .GetValue("WebS erviceConnectio ns"));
hklm.Close();

WebService.Cred entials = System.Net.Cred entialCache.Def aultCredentials ;
WebService.Time out = ServiceTimeout;

HttpWebResponse res = null;
HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate (WebService.Url );
res = (HttpWebRespons e)req.GetRespon se ();
ServicePoint currentServiceP oint = req.ServicePoin t;
currentServiceP oint.MaxIdleTim e = ServiceTimeout;
currentServiceP oint.Connection Limit = ServiceConnecti ons;

}
"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
http://www.phoneanalyser.net
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.


Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4083
by: Generic Usenet Account | last post by:
Most of the open source web-service products that I am reading about seem to require generation of client stub and server implementation ancestor classes from the WSDL file. The client application links in with the stubs. Like CORBA SII, the client operates on a proxy (albeit a "service proxy" and not an "object proxy") in its address space. This approach seems to limit the scope of web services. Is there an equivalent of CORBA DII...
5
3088
by: Ron | last post by:
I have a bunch of Crystal Reports (v9) published as WebServices and use a ReportViewer to display the reports on the ASPNET page. Everytime we move the reports from dev to production we have to open the reports and manually change the datasouce to the production database. Is there a way to set the datasouce on the webserviced reports dynamically? (A datasource property or something?) cant seem to find anything. Thanks!
5
3084
by: Demetri | last post by:
Is it possible to add a web service reference during runtime? If so, how? -- -Demetri
3
1371
by: Tim Zych | last post by:
To create a web service proxy you can use wsdl.exe and vbc.exe using command line, then set a reference to the resulting dll, or alternatively add a web reference and let vs.net do it all for us. Does the manual command line way offer any advantages over the other? Why would a developer want to use command line to do that instead of the automatic way?
2
1471
by: WhiskyRomeo | last post by:
I am trying to use dynamic URL and the app.config to specify the actuall url of a web service. It isn't working. When using static URL there is no problem. The name of my application is DMS.exe. The DMS.Exe.Config file has the following entry: <add key="DMS.Oscar.wsCommon" value="http://Oscar/DMSDataWS/wsCommon.asmx"/> The name of the server at the customer site is Oscar.
7
22498
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
5
6219
by: Kimba | last post by:
Hi. Using VStudio I have developed a WebService which I placed onto several servers. However my application can only access one on server. During runtime, I tried to change the URL of the webreference to the other server but that does not work -- the webreference still thinks it is the old one and errors out. I need to be able to dynamically switch from one server to the other, but
2
2540
by: James | last post by:
Hello, I have an existing MFC C++ project which I need to add the ability of sending WSDL calls out to a web service. When this project is deployed the web service URL will always change depending on the user's local setup. I can use the "Add a Web Reference" wizard to do this, however when the project is in C++ the option to set the URL Behaviour to Dynamic is not in the property list. I noticed if I create a C# project however,...
1
2300
by: webServiceHelp | last post by:
hi... I have deployed a web service ..generated wsdl. but i can't understand how to do my ultimate job. I want to do the following.. 1) The Requestor would find "the Service" from the "UDDI registry" nd may also get the WSDL / Service URL etc.. (which will be effective) 2) Now the Requestor would generate the "Client" at runtime (i.e
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.